Skip to content

Commit

Permalink
Merge pull request #5 from drewler/fix/path-transform
Browse files Browse the repository at this point in the history
Fix path transform and deprecation warnings
  • Loading branch information
PadLex authored Jul 26, 2020
2 parents a94b4c3 + e19a069 commit f78be04
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions laser.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
import inkex
import simpletransform
from inkex.transforms import Transform
from inkex.paths import Path

import os
import math
Expand Down Expand Up @@ -925,8 +926,8 @@ def get_transforms(self, g):
while (g != root):
if 'transform' in list(g.keys()):
t = g.get('transform')
t = simpletransform.parseTransform(t)
trans = simpletransform.composeTransform(t, trans) if trans != [] else t
t = [list(row) for row in Transform(t).matrix]
trans = [list(row) for row in (Transform(t) * Transform(trans)).matrix] if trans != [] else t
print_(trans)
g = g.getparent()
return trans
Expand All @@ -935,7 +936,7 @@ def get_transforms(self, g):
def apply_transforms(self, g, csp):
trans = self.get_transforms(g)
if trans != []:
simpletransform.applyTransformToPath(trans, csp)
csp = Path(csp).transform(Transform(trans)).to_superpath()
return csp


Expand Down

0 comments on commit f78be04

Please sign in to comment.