From 8df19f1c12ec5de9ec74a628bf69b9cfc0522784 Mon Sep 17 00:00:00 2001 From: Andrew Port Date: Sat, 9 Jul 2022 19:49:12 -0300 Subject: [PATCH] fixed issue 171 --- svgpathtools/path.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/svgpathtools/path.py b/svgpathtools/path.py index f28941e..7418615 100644 --- a/svgpathtools/path.py +++ b/svgpathtools/path.py @@ -294,6 +294,10 @@ def scale(curve, sx, sy=None, origin=0j): def transform(curve, tf): """Transforms the curve by the homogeneous transformation matrix tf""" + + if all((tf == np.eye(3)).ravel()): + return curve # tf is identity, return curve as is + def to_point(p): return np.array([[p.real], [p.imag], [1.0]]) @@ -311,8 +315,6 @@ def transform(curve, tf): return bpoints2bezier([to_complex(tf.dot(to_point(p))) for p in curve.bpoints()]) elif isinstance(curve, Arc): - if curve == Arc(start=(-3600000-31200000j), radius=(400000+400000j), rotation=0.0, large_arc=True, sweep=False, end=(-2800000-31200000j)): - from IPython import embed; embed() ### DEBUG new_start = to_complex(tf.dot(to_point(curve.start))) new_end = to_complex(tf.dot(to_point(curve.end))) @@ -339,7 +341,7 @@ def transform(curve, tf): else : return Arc(new_start, radius=new_radius, rotation=curve.rotation + rot, large_arc=curve.large_arc, sweep=curve.sweep, end=new_end, - autoscale_radius=False) + autoscale_radius=True) else: raise TypeError("Input `curve` should be a Path, Line, "