Skip to content

Commit 6070531

Browse files
committed
Set type of stroke_width to np.array
1 parent f8f750c commit 6070531

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

manim/mobject/opengl/opengl_vectorized_mobject.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ def __init__(
124124
self.data = {}
125125
self.fill_opacity = fill_opacity
126126
self.stroke_opacity = stroke_opacity
127-
self.stroke_width = stroke_width
127+
self.stroke_width = np.array([[stroke_width]])
128128
self.draw_stroke_behind_fill = draw_stroke_behind_fill
129129
# Indicates that it will not be displayed, but
130130
# that it should count in parent mobject's path
@@ -267,6 +267,8 @@ def set_stroke(
267267
background=None,
268268
recurse=True,
269269
):
270+
if width is None:
271+
width = np.array([[0]])
270272
if opacity is not None:
271273
self.stroke_opacity = opacity
272274
if recurse:
@@ -283,7 +285,7 @@ def set_stroke(
283285

284286
if width is not None:
285287
for mob in self.get_family(recurse):
286-
mob.stroke_width = np.array([[width] for width in tuplify(width)])
288+
mob.stroke_width = np.array(width)
287289

288290
if background is not None:
289291
for mob in self.get_family(recurse):

0 commit comments

Comments
 (0)