mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
some refactors
This commit is contained in:
parent
790bf0a104
commit
8db1164ece
1 changed files with 7 additions and 8 deletions
|
@ -237,14 +237,13 @@ class SVGMobject(VMobject):
|
||||||
return mob
|
return mob
|
||||||
|
|
||||||
def handle_transforms(self, element, mobject):
|
def handle_transforms(self, element, mobject):
|
||||||
x, y = 0, 0
|
x, y = (
|
||||||
try:
|
self.attribute_to_float(element.getAttribute(key))
|
||||||
x = self.attribute_to_float(element.getAttribute('x'))
|
if element.hasAttribute(key)
|
||||||
# Flip y
|
else 0.0
|
||||||
y = -self.attribute_to_float(element.getAttribute('y'))
|
for key in ("x", "y")
|
||||||
mobject.shift([x, y, 0])
|
)
|
||||||
except Exception:
|
mobject.shift(x * RIGHT + y * DOWN)
|
||||||
pass
|
|
||||||
|
|
||||||
transform_names = [
|
transform_names = [
|
||||||
"matrix",
|
"matrix",
|
||||||
|
|
Loading…
Add table
Reference in a new issue