mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 12:57:45 +00:00
Don't have VMobject refresh joint angles on shift, scale and rotate
This commit is contained in:
parent
e4007f6915
commit
bcafcbf490
1 changed files with 23 additions and 0 deletions
|
|
@ -1278,6 +1278,29 @@ class VMobject(Mobject):
|
|||
def apply_points_function(self, *args, **kwargs) -> Self:
|
||||
return super().apply_points_function(*args, **kwargs)
|
||||
|
||||
# General calls to apply_points_function should trigger a refresh
|
||||
# to the joint angles, but these common ones shouldn't
|
||||
def dont_refresh_joint_angles(func: Callable):
|
||||
@wraps(func)
|
||||
def wrapper(self, *args, **kwargs):
|
||||
nnja = self.needs_new_joint_angles
|
||||
result = func(self, *args, **kwargs)
|
||||
self.needs_new_joint_angles = nnja
|
||||
return result
|
||||
return wrapper
|
||||
|
||||
@dont_refresh_joint_angles
|
||||
def shift(self, *args, **kwargs) -> Self:
|
||||
return super().shift(*args, **kwargs)
|
||||
|
||||
@dont_refresh_joint_angles
|
||||
def scale(self, *args, **kwargs) -> Self:
|
||||
return super().scale(*args, **kwargs)
|
||||
|
||||
@dont_refresh_joint_angles
|
||||
def rotate(self, *args, **kwargs) -> Self:
|
||||
return super().rotate(*args, **kwargs)
|
||||
|
||||
def set_animating_status(self, is_animating: bool, recurse: bool = True):
|
||||
super().set_animating_status(is_animating, recurse)
|
||||
for submob in self.get_family(recurse):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue