Select the last object of the group as the alignment target when using Mobject.arrange()
#4183
Labels
new feature
Enhancement specifically adding a new feature (feature request should be used for issues instead)
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
last
inMobject.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 thedirection
param asLEFT
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:ReversedArrange.mp4
The text was updated successfully, but these errors were encountered: