Skip to content

Rename update function dot_position to update_label in .add_updater example #4196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions manim/mobject/mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -1002,13 +1002,13 @@ def add_updater(

class NextToUpdater(Scene):
def construct(self):
def dot_position(mobject):
def update_label(mobject):
mobject.set_value(dot.get_center()[0])
mobject.next_to(dot)

dot = Dot(RIGHT*3)
label = DecimalNumber()
label.add_updater(dot_position)
label.add_updater(update_label)
self.add(dot, label)

self.play(Rotating(dot, about_point=ORIGIN, angle=TAU, run_time=TAU, rate_func=linear))
Expand Down