File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,6 @@ def add_updater(*method_args, **method_kwargs):
99
99
lambda m : getattr (m , name )(* method_args , ** method_kwargs ),
100
100
call_updater = True ,
101
101
)
102
- return mob
102
+ return self
103
103
104
104
return add_updater
Original file line number Diff line number Diff line change @@ -395,7 +395,9 @@ def construct(self):
395
395
def always (self ) -> Self :
396
396
"""Call a method on a mobject every frame.
397
397
398
- This is syntactic sugar for ``mob.add_updater(lambda m: m.method())``
398
+ This is syntactic sugar for ``mob.add_updater(lambda m: m.method(*args, **kwargs), call_updater=True)``.
399
+ Note that this will call the method immediately. If this behavior is not
400
+ desired, you should use :meth:`add_updater` directly.
399
401
400
402
.. warning::
401
403
@@ -413,12 +415,13 @@ def always(self) -> Self:
413
415
class AlwaysExample(Scene):
414
416
def construct(self):
415
417
sq = Square().to_edge(LEFT)
416
- t = Text("Hello World!").always.next_to(sq, UP)
418
+ t = Text("Hello World!")
419
+ t.always.next_to(sq, UP)
417
420
self.add(sq, t)
418
421
self.play(sq.animate.to_edge(RIGHT))
419
422
420
423
"""
421
- # can't use typing.cast because Self is under typing_extensions
424
+ # can't use typing.cast because Self is under TYPE_CHECKING
422
425
return _UpdaterBuilder (self ) # type: ignore
423
426
424
427
def __deepcopy__ (self , clone_from_id ) -> Self :
You can’t perform that action at this time.
0 commit comments