Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

fix: fix cast crash in OpenGLMobject.arrange_in_grid() and OpenGLPoint.get_location() (#4622)

Colin Belhommed4af5b2baa62
diff --git a/manim/mobject/opengl/opengl_mobject.py b/manim/mobject/opengl/opengl_mobject.py
index 4bb2733d7..52cb3f3ac 100644
--- a/manim/mobject/opengl/opengl_mobject.py
+++ b/manim/mobject/opengl/opengl_mobject.py
@@ -1222,7 +1222,7 @@ class OpenGLMobject:
) -> Sequence[Vector3D]:
if str_alignments is None:
# Use cell_alignment as fallback
- return [cast(Vector3D, cell_alignment * direction)] * num
+ return [cast("Vector3D", cell_alignment * direction)] * num
if len(str_alignments) != num:
raise ValueError(f"{name}_alignments has a mismatching size.")
return [mapping[letter] for letter in str_alignments]
@@ -3037,7 +3037,7 @@ class OpenGLPoint(OpenGLMobject):
return self.artificial_height
def get_location(self) -> Point3D:
- return cast(Point3D, self.points[0]).copy()
+ return cast("Point3D", self.points[0]).copy()
@override
def get_bounding_box_point(self, *args: object, **kwargs: Any) -> Point3D: