From bc271fa1e94c788fa2f1056fe50b4137fc1164ec Mon Sep 17 00:00:00 2001 From: Vihaan Dutta Date: Mon, 20 Apr 2026 12:32:44 -0400 Subject: [PATCH] Fixed text center of rotation for add_fixed_orientation_mobjects() --- manim/mobject/opengl/opengl_mobject.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/manim/mobject/opengl/opengl_mobject.py b/manim/mobject/opengl/opengl_mobject.py index e624dc2e58..b99cd05a32 100644 --- a/manim/mobject/opengl/opengl_mobject.py +++ b/manim/mobject/opengl/opengl_mobject.py @@ -2841,11 +2841,16 @@ def fix_in_frame(self) -> Self: self.is_fixed_in_frame = 1.0 return self - @affects_shader_info_id def fix_orientation(self) -> Self: - self.is_fixed_orientation = 1.0 - self.fixed_orientation_center = tuple(self.get_center()) - self.depth_test = True + # do not use @affects_shader_info_id: that invokes this once per family + # member with that member as self, so each submobject would use its own + # get_center(). simply share one pivot for the whole tree. + anchor = tuple(self.get_center()) + for mob in self.get_family(): + mob.is_fixed_orientation = 1.0 + mob.fixed_orientation_center = anchor + mob.depth_test = True + mob.refresh_shader_wrapper_id() return self @affects_shader_info_id