mirror of
https://github.com/3b1b/manim.git
synced 2025-09-19 04:41:56 +00:00
Merge pull request #349 from sswatson/patch-4
SVG single-factor scaling
This commit is contained in:
commit
a4f1e762d6
1 changed files with 7 additions and 2 deletions
|
@ -264,8 +264,13 @@ class SVGMobject(VMobject):
|
|||
if not transform.startswith(prefix) or not transform.endswith(suffix):
|
||||
raise Exception()
|
||||
transform = transform[len(prefix):-len(suffix)]
|
||||
scale_x, scale_y = string_to_numbers(transform)
|
||||
mobject.scale(np.array([scale_x, scale_y, 1]))
|
||||
scale_values = string_to_numbers(transform)
|
||||
if len(scale_values) == 2:
|
||||
scale_x, scale_y = scale_values
|
||||
mobject.scale(np.array([scale_x, scale_y, 1]))
|
||||
elif len(scale_values) == 1:
|
||||
scale = scale_values[0]
|
||||
mobject.scale(np.array([scale,scale,1]), about_point = ORIGIN)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue