diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2018-08-17 16:21:58 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-17 16:21:58 -0400 |
| commit | f0bd1404ad078a71eb3bca1a9fef7858e709ec0c (patch) | |
| tree | 2075fc0292038b4a2e92fc018b503805cf30fdec /lib/svg/path.py | |
| parent | ece81d0c91c8b96f7da2c0339f6807a47d57112e (diff) | |
| parent | 0e4c3a3f1b76c1b655ec2788017335e87eff29da (diff) | |
Merge pull request #243 from inkstitch/lexelby-no-embroider-command
"ignore" command
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 |
