Fix Write bug (#1740)

* Avoid division by zero error for calling Write on null objects
This commit is contained in:
Grant Sanderson 2022-02-13 20:04:05 -08:00 committed by GitHub
parent 602809758e
commit b3b7d214ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -146,7 +146,7 @@ class Write(DrawBorderThenFill):
else: else:
self.run_time = 2 self.run_time = 2
if self.lag_ratio is None: if self.lag_ratio is None:
self.lag_ratio = min(4.0 / length, 0.2) self.lag_ratio = min(4.0 / (length + 1.0), 0.2)
class ShowIncreasingSubsets(Animation): class ShowIncreasingSubsets(Animation):