Fixed text center of rotation for add_fixed_orientation_mobjects()#4701
Open
vihdutta wants to merge 1 commit intoManimCommunity:mainfrom
Open
Fixed text center of rotation for add_fixed_orientation_mobjects()#4701vihdutta wants to merge 1 commit intoManimCommunity:mainfrom
vihdutta wants to merge 1 commit intoManimCommunity:mainfrom
Conversation
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview: What does this pull request change?
Modified the fix_orientation function under opengl_mobject.py to fix an error in center of rotation for text objects according to #4644 . The @affects_shader_info_id decorator called fix_orientation once per submobject, so each glyph used its own get_center() as the pivot instead of the whole label’s center. I changed it so that it computes a single anchor from the mobject fix_orientation is called on, then uses that one point for every part of the label (every submobject). This makes it so the whole string spins as a single unit around the text's real middle.
Motivation and Explanation: Why and how do your changes improve the library?
Bugfix.
Links to added or changed documentation pages
Added comment under the fix_orientation() function to detail why "@affects_shader_info_id" is not being used from this PR (since the surrounding functions use it).
Further Information and Comments
Showing the text rotation works properly given the reproduction code/example from issue #4644
This was also ran on the OpenGL renderer (like #4644 ) but on Windows 11.
Reviewer Checklist