Skip to content

Commit 54ad355

Browse files
committed
Fix bug with SVG rectangles
1 parent d19b386 commit 54ad355

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

manimlib/mobject/svg/svg_mobject.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,9 @@ def rect_to_mobject(self, rect_element):
184184
corner_radius = rect_element.getAttribute("rx")
185185

186186
# input preprocessing
187+
fill_opacity = 1
187188
if fill_color in ["", "none", "#FFF", "#FFFFFF"] or Color(fill_color) == Color(WHITE):
188-
opacity = 0
189+
fill_opacity = 0
189190
fill_color = BLACK # shdn't be necessary but avoids error msgs
190191
if fill_color in ["#000", "#000000"]:
191192
fill_color = WHITE
@@ -213,7 +214,7 @@ def rect_to_mobject(self, rect_element):
213214
stroke_width=stroke_width,
214215
stroke_color=stroke_color,
215216
fill_color=fill_color,
216-
fill_opacity=opacity
217+
fill_opacity=fill_opacity
217218
)
218219
else:
219220
mob = RoundedRectangle(
@@ -321,7 +322,7 @@ def update_ref_to_element(self, defs):
321322

322323
class VMobjectFromSVGPathstring(VMobject):
323324
CONFIG = {
324-
"long_lines": True,
325+
"long_lines": False,
325326
"should_subdivide_sharp_curves": False,
326327
"should_remove_null_curves": False,
327328
}

0 commit comments

Comments
 (0)