diff --git a/manim/mobject/opengl/opengl_vectorized_mobject.py b/manim/mobject/opengl/opengl_vectorized_mobject.py index d486dc5c76..ec6465e823 100644 --- a/manim/mobject/opengl/opengl_vectorized_mobject.py +++ b/manim/mobject/opengl/opengl_vectorized_mobject.py @@ -1200,7 +1200,7 @@ def align_points(self, vmobject): def get_nth_subpath(path_list, n): if n >= len(path_list): # Create a null path at the very end - return [path_list[-1][-1]] * nppc + return np.array([path_list[-1][-1]] * nppc) path = path_list[n] # Check for useless points at the end of the path and remove them # https://github.com/ManimCommunity/manim/issues/1959 diff --git a/tests/opengl/test_opengl_vectorized_mobject.py b/tests/opengl/test_opengl_vectorized_mobject.py index 8e0ba22582..01aff2a71f 100644 --- a/tests/opengl/test_opengl_vectorized_mobject.py +++ b/tests/opengl/test_opengl_vectorized_mobject.py @@ -3,7 +3,7 @@ import numpy as np import pytest -from manim import Circle, Line, Square, VDict, VGroup +from manim import Circle, Line, Square, Text, VDict, VGroup from manim.mobject.opengl.opengl_mobject import OpenGLMobject from manim.mobject.opengl.opengl_vectorized_mobject import OpenGLVMobject @@ -32,6 +32,14 @@ def test_opengl_vmobject_point_from_propotion(using_opengl_renderer): obj.point_from_proportion(0) +def test_opengl_align_family_and_data(using_opengl_renderer): + text_c = Text("c") + text_o = Text("o") + assert text_c.get_all_points().shape != text_o.get_all_points().shape + text_c.align_data_and_family(text_o) + assert text_c.get_all_points().shape == text_o.get_all_points().shape + + def test_vgroup_init(using_opengl_renderer): """Test the VGroup instantiation.""" VGroup()