Skip to content

Commit

Permalink
Fix bug with SVG rectangles
Browse files Browse the repository at this point in the history
  • Loading branch information
3b1b committed Oct 1, 2021
1 parent d19b386 commit 54ad355
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions manimlib/mobject/svg/svg_mobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,9 @@ def rect_to_mobject(self, rect_element):
corner_radius = rect_element.getAttribute("rx")

# input preprocessing
fill_opacity = 1
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
if fill_color in ["#000", "#000000"]:
fill_color = WHITE
Expand Down Expand Up @@ -213,7 +214,7 @@ def rect_to_mobject(self, rect_element):
stroke_width=stroke_width,
stroke_color=stroke_color,
fill_color=fill_color,
fill_opacity=opacity
fill_opacity=fill_opacity
)
else:
mob = RoundedRectangle(
Expand Down Expand Up @@ -321,7 +322,7 @@ def update_ref_to_element(self, defs):

class VMobjectFromSVGPathstring(VMobject):
CONFIG = {
"long_lines": True,
"long_lines": False,
"should_subdivide_sharp_curves": False,
"should_remove_null_curves": False,
}
Expand Down

0 comments on commit 54ad355

Please sign in to comment.