Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Fixed opengl shift animation for :class:~.Text (#2026)

Ryan McCauley3b55ea5e9e0e
diff --git a/manim/animation/animation.py b/manim/animation/animation.py
index e37ac98af..67ac6ed5f 100644
--- a/manim/animation/animation.py
+++ b/manim/animation/animation.py
@@ -1,7 +1,7 @@
"""Animate mobjects."""
-from .. import logger
+from .. import config, logger
from ..mobject import mobject, opengl_mobject
from ..mobject.mobject import Mobject
from ..mobject.opengl_mobject import OpenGLMobject
@@ -221,6 +221,8 @@ class Animation:
return self.mobject, self.starting_mobject
def get_all_families_zipped(self) -> Iterable[Tuple]:
+ if config["renderer"] == "opengl":
+ return zip(*(mob.get_family() for mob in self.get_all_mobjects()))
return zip(
*(mob.family_members_with_points() for mob in self.get_all_mobjects())
)
diff --git a/manim/animation/transform.py b/manim/animation/transform.py
index fda24b959..176276dbc 100644
--- a/manim/animation/transform.py
+++ b/manim/animation/transform.py
@@ -138,6 +138,8 @@ class Transform(Animation):
self.starting_mobject,
self.target_copy,
]
+ if config["renderer"] == "opengl":
+ return zip(*(mob.get_family() for mob in mobs))
return zip(*(mob.family_members_with_points() for mob in mobs))
def interpolate_submobject(