diff options
| author | Lex Neva <github.com@lexneva.name> | 2018-07-30 14:57:54 -0400 |
|---|---|---|
| committer | Lex Neva <github.com@lexneva.name> | 2018-07-30 14:57:54 -0400 |
| commit | 8d41d0f9af0e5390dacdfa2a18e213955aef8ddf (patch) | |
| tree | 6d07f18b6ae5272194403c3e350923aba9cbc99d /lib/svg/path.py | |
| parent | 395067f97e641110727c44bb2605050338fe3b98 (diff) | |
convert to satin extension
Diffstat (limited to 'lib/svg/path.py')
| -rw-r--r-- | lib/svg/path.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/svg/path.py b/lib/svg/path.py index 2d9c0ff3..00e2c269 100644 --- a/lib/svg/path.py +++ b/lib/svg/path.py @@ -23,3 +23,20 @@ def get_node_transform(node): transform = simpletransform.composeTransform(viewbox_transform, transform) return transform + +def get_correction_transform(node): + """Get a transform to apply to new siblings of this SVG node""" + + # if we want to place our new nodes in the same group/layer as this node, + # then we'll need to factor in the effects of any transforms set on + # the parents of this node. + + # we can ignore the transform on the node itself since it won't apply + # to the objects we add + transform = get_node_transform(node.getparent()) + + # now invert it, so that we can position our objects in absolute + # coordinates + transform = simpletransform.invertTransform(transform) + + return simpletransform.formatTransform(transform) |
