diff options
Diffstat (limited to 'lib/svg/path.py')
| -rw-r--r-- | lib/svg/path.py | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/svg/path.py b/lib/svg/path.py index 52144332..0a8dcb74 100644 --- a/lib/svg/path.py +++ b/lib/svg/path.py @@ -26,16 +26,19 @@ def get_node_transform(node): return transform -def get_correction_transform(node): - """Get a transform to apply to new siblings of this SVG node""" +def get_correction_transform(node, child=False): + """Get a transform to apply to new siblings or children 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()) + if child: + transform = get_node_transform(node) + else: + # 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 |
