Skip to content

Commit abafa8a

Browse files
committed
Don’t crash when more than 2 values are given to translate and scale
Fix #432.
1 parent 9a1bf51 commit abafa8a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

cairosvg/helpers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,11 @@ def transform(surface, transform_string, gradient=None, transform_origin=None):
264264
elif transformation_type == 'translate':
265265
if len(values) == 1:
266266
values += (0,)
267-
matrix.translate(*values)
267+
matrix.translate(*values[:2])
268268
elif transformation_type == 'scale':
269269
if len(values) == 1:
270270
values = 2 * values
271-
matrix.scale(*values)
271+
matrix.scale(*values[:2])
272272

273273
if transform_origin:
274274
matrix.translate(-float(origin_x), -float(origin_y))

0 commit comments

Comments
 (0)