Skip to content

Commit

Permalink
Support anchors named by compass positions
Browse files Browse the repository at this point in the history
  • Loading branch information
spakin committed Dec 25, 2023
1 parent 9c5a521 commit 3f15215
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions simpinkscr/simple_inkscape_scripting.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,14 +692,22 @@ def _find_transform_point(self, around):
return inkex.Vector2d(0, 0)
if around in ['c', 'center']:
around = bbox.center
elif around == 'ul':
elif around in ['ul', 'nw']:
around = inkex.Vector2d(bbox.left, bbox.top)
elif around == 'ur':
elif around in ['ur', 'ne']:
around = inkex.Vector2d(bbox.right, bbox.top)
elif around == 'll':
elif around in ['ll', 'sw']:
around = inkex.Vector2d(bbox.left, bbox.bottom)
elif around == 'lr':
elif around in ['lr', 'se']:
around = inkex.Vector2d(bbox.right, bbox.bottom)
elif around == 'n':
around = inkex.Vector2d(bbox.center_x, bbox.top)
elif around == 's':
around = inkex.Vector2d(bbox.center_x, bbox.bottom)
elif around == 'e':
around = inkex.Vector2d(bbox.right, bbox.center_y)
elif around == 'w':
around = inkex.Vector2d(bbox.left, bbox.center_y)
else:
_abend(_('Unexpected transform argument %s') % repr(around))
else:
Expand Down

0 comments on commit 3f15215

Please sign in to comment.