Resolving minor bug in StreamLines (#2330)

* resolving minor bug in StreamLines

* minute changes
This commit is contained in:
Varniex 2025-06-10 20:35:07 +05:30 committed by GitHub
parent c667136060
commit 8b9ae95703
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 4 deletions

View file

@ -257,7 +257,7 @@ def update_camera_config(config: Dict, args: Namespace):
if args.color:
try:
camera_config.background_color = colour.Color(args.color)
except Exception:
except Exception as err:
log.error("Please use a valid color")
log.error(err)
sys.exit(2)

View file

@ -390,7 +390,6 @@ class StreamLines(VGroup):
def draw_lines(self) -> None:
lines = []
origin = self.coordinate_system.get_origin()
# Todo, it feels like coordinate system should just have
# the ODE solver built into it, no?
@ -426,7 +425,7 @@ class StreamLines(VGroup):
cs = self.coordinate_system
for line in self.submobjects:
norms = [
get_norm(self.func(*cs.p2c(point)))
get_norm(self.func(cs.p2c(point)))
for point in line.get_points()
]
rgbs = values_to_rgbs(norms)
@ -471,7 +470,7 @@ class AnimatedStreamLines(VGroup):
self.add_updater(lambda m, dt: m.update(dt))
def update(self, dt: float) -> None:
def update(self, dt: float = 0) -> None:
stream_lines = self.stream_lines
for line in stream_lines:
line.time += dt