Fix bug with SVG rectangles

This commit is contained in:
Grant Sanderson
2021-10-01 12:32:04 -07:00
parent d19b386415
commit 54ad3550ef

View File

@ -184,8 +184,9 @@ class SVGMobject(VMobject):
corner_radius = rect_element.getAttribute("rx") corner_radius = rect_element.getAttribute("rx")
# input preprocessing # input preprocessing
fill_opacity = 1
if fill_color in ["", "none", "#FFF", "#FFFFFF"] or Color(fill_color) == Color(WHITE): if fill_color in ["", "none", "#FFF", "#FFFFFF"] or Color(fill_color) == Color(WHITE):
opacity = 0 fill_opacity = 0
fill_color = BLACK # shdn't be necessary but avoids error msgs fill_color = BLACK # shdn't be necessary but avoids error msgs
if fill_color in ["#000", "#000000"]: if fill_color in ["#000", "#000000"]:
fill_color = WHITE fill_color = WHITE
@ -213,7 +214,7 @@ class SVGMobject(VMobject):
stroke_width=stroke_width, stroke_width=stroke_width,
stroke_color=stroke_color, stroke_color=stroke_color,
fill_color=fill_color, fill_color=fill_color,
fill_opacity=opacity fill_opacity=fill_opacity
) )
else: else:
mob = RoundedRectangle( mob = RoundedRectangle(
@ -321,7 +322,7 @@ class SVGMobject(VMobject):
class VMobjectFromSVGPathstring(VMobject): class VMobjectFromSVGPathstring(VMobject):
CONFIG = { CONFIG = {
"long_lines": True, "long_lines": False,
"should_subdivide_sharp_curves": False, "should_subdivide_sharp_curves": False,
"should_remove_null_curves": False, "should_remove_null_curves": False,
} }