mirror of
https://github.com/3b1b/manim.git
synced 2025-07-28 20:43:56 +08:00
Closes: #720
Fix to interpret subsequent points of absolute MoveTo (M) command as absolute LineTo (L).
This commit is contained in:
@ -298,7 +298,7 @@ class SVGMobject(VMobject):
|
|||||||
if not isinstance(element, minidom.Element):
|
if not isinstance(element, minidom.Element):
|
||||||
return
|
return
|
||||||
if element.hasAttribute('id'):
|
if element.hasAttribute('id'):
|
||||||
return element
|
return [element]
|
||||||
for e in element.childNodes:
|
for e in element.childNodes:
|
||||||
all_childNodes_have_id.append(self.get_all_childNodes_have_id(e))
|
all_childNodes_have_id.append(self.get_all_childNodes_have_id(e))
|
||||||
return self.flatten([e for e in all_childNodes_have_id if e])
|
return self.flatten([e for e in all_childNodes_have_id if e])
|
||||||
@ -371,11 +371,11 @@ class VMobjectFromSVGPathstring(VMobject):
|
|||||||
new_points = new_points[1:]
|
new_points = new_points[1:]
|
||||||
command = "L"
|
command = "L"
|
||||||
|
|
||||||
# Treat everything as relative line-to until empty
|
|
||||||
for p in new_points:
|
for p in new_points:
|
||||||
# Treat as relative
|
if isLower:
|
||||||
p[0] += self.points[-1, 0]
|
# Treat everything as relative line-to until empty
|
||||||
p[1] += self.points[-1, 1]
|
p[0] += self.points[-1, 0]
|
||||||
|
p[1] += self.points[-1, 1]
|
||||||
self.add_line_to(p)
|
self.add_line_to(p)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user