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
|
||||
|
||||
def handle_transforms(self, element, mobject):
|
||||
x, y = 0, 0
|
||||
try:
|
||||
x = self.attribute_to_float(element.getAttribute('x'))
|
||||
# Flip y
|
||||
y = -self.attribute_to_float(element.getAttribute('y'))
|
||||
mobject.shift([x, y, 0])
|
||||
except Exception:
|
||||
pass
|
||||
x, y = (
|
||||
self.attribute_to_float(element.getAttribute(key))
|
||||
if element.hasAttribute(key)
|
||||
else 0.0
|
||||
for key in ("x", "y")
|
||||
)
|
||||
mobject.shift(x * RIGHT + y * DOWN)
|
||||
|
||||
transform_names = [
|
||||
"matrix",
|
||||
|
|
Loading…
Add table
Reference in a new issue