Skip to content

fix(mobject): get_start/get_end fall back to submobject points#4852

Open
Chessing234 wants to merge 1 commit into
ManimCommunity:mainfrom
Chessing234:fix/4510-get-start-empty-family
Open

fix(mobject): get_start/get_end fall back to submobject points#4852
Chessing234 wants to merge 1 commit into
ManimCommunity:mainfrom
Chessing234:fix/4510-get-start-empty-family

Conversation

@Chessing234

Copy link
Copy Markdown

Changelog / Overview

get_start()/get_end() raised Cannot call Mobject.get_start for a Mobject with no points whenever the top-level mobject had no own points, ignoring points held on submobjects.

Cause

The result of TransformFromCopy(Text(...), circle) (and any Text/Tex-shaped target) keeps its points on submobjects; the top level is empty. get_start/get_end only looked at self.points and errored.

Fix

Fall back to family_members_with_points() (first/last member) before throwing, matching how DashedLine already resolves start/end.

Testing

mobject = Circle(); text = Text("Hello, World!")
self.add(text); self.play(TransformFromCopy(text, mobject))
mobject.get_start()   # before: raises; after: [1. 0. 0.]

tests/module/mobject/ pass (unrelated typst-binary tests aside).

Fixes #4510

Made with Cursor

get_start/get_end raised "no points" whenever the top-level mobject had
no own points, even though its submobjects did. This breaks e.g. the
result of TransformFromCopy(Text(...), circle), whose points end up on
submobjects. Fall back to family_members_with_points before erroring.

Fixes ManimCommunity#4510

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Mobject created from TransformFromCopy has no start

1 participant