Skip to content

Commit

Permalink
Merge pull request #50 from vmario89/master
Browse files Browse the repository at this point in the history
Fix stroke-width handling
  • Loading branch information
Klowner authored Nov 30, 2021
2 parents 0781b78 + 735e503 commit bbe0f17
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions applytransform.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ def scaleStrokeWidth(self, node, transf):

if 'stroke-width' in style:
try:
stroke_width = self.svg.uutounit(style.get('stroke-width').strip())
stroke_width *= math.sqrt(abs(transf.a * transf.d))
stroke_width = self.svg.unittouu(style.get('stroke-width')) / self.svg.unittouu("1px")
stroke_width *= math.sqrt(abs(transf.a * transf.d - transf.b * transf.c))
style['stroke-width'] = str(stroke_width)
update = True
except AttributeError:
except AttributeError as e:
pass

if update:
Expand Down

0 comments on commit bbe0f17

Please sign in to comment.