You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I want to be able to select the last object in a group as the target for alignment when using Mobject.arrange(), instead of the default first object.
Like this:
ReversedArrange.mp4
Why
Mobject.arrange() always uses the first object as the alignment target:
If I want to implement reverse-arrange, I must use the Mobject.next_to() method one by one (in reverse order) for the objects within the group, as implemented in above code.
If modify Mobject.arrange() as I did, you have to specify the direction param as LEFT when call this method, otherwise the other object in the group will move to the right of the target object (which is assumed to be the rightmost one). Like this:
self.play(group.animate.arrange(center=False, last=True)) # without direction=LEFT
Description of proposed feature
My motivation
Hello, I want to be able to select the last object in a group as the target for alignment when using
Mobject.arrange(), instead of the default first object.Like this:
ReversedArrange.mp4
Why
Mobject.arrange()always uses the first object as the alignment target:manim/manim/mobject/mobject.py
Lines 2368 to 2372 in 2ab99b5
If I want to implement reverse-arrange, I must use the
Mobject.next_to()method one by one (in reverse order) for the objects within the group, as implemented in above code.How can the new feature be used?
By adding a new param
lastinMobject.arrange():Additional comments
Here is my change of
Mobject.arrange()to implement this feature:Here is my code to test this feature:
If modify
Mobject.arrange()as I did, you have to specify thedirectionparam asLEFTwhen call this method, otherwise the other object in the group will move to the right of the target object (which is assumed to be the rightmost one). Like this:ReversedArrange.mp4