summaryrefslogtreecommitdiff
path: root/lib/svg
diff options
context:
space:
mode:
authorLex Neva <lexelby@users.noreply.github.com>2018-07-13 19:51:25 -0400
committerGitHub <noreply@github.com>2018-07-13 19:51:25 -0400
commitc6ebfea5425229f19e12d40391ff1d6253ea4c55 (patch)
tree58a53c0730c516b9ce53ec873fd23e9463cb631f /lib/svg
parent67342608b0d059bc3ec79001e62d0bc0cdb251d4 (diff)
parent6caba7b839e9f4e90ab9f3ff1110c8759e30337d (diff)
Merge pull request #224 from inkstitch/lexelby-trim-stop-commands
trim and stop commands
Diffstat (limited to 'lib/svg')
-rw-r--r--lib/svg/__init__.py2
-rw-r--r--lib/svg/path.py13
-rw-r--r--lib/svg/tags.py1
3 files changed, 11 insertions, 5 deletions
diff --git a/lib/svg/__init__.py b/lib/svg/__init__.py
index 50543b1b..8e846555 100644
--- a/lib/svg/__init__.py
+++ b/lib/svg/__init__.py
@@ -1,3 +1,3 @@
from .svg import color_block_to_point_lists, render_stitch_plan
from .units import *
-from .path import apply_transforms
+from .path import apply_transforms, get_node_transform
diff --git a/lib/svg/path.py b/lib/svg/path.py
index a8012774..2d9c0ff3 100644
--- a/lib/svg/path.py
+++ b/lib/svg/path.py
@@ -4,6 +4,14 @@ import cubicsuperpath
from .units import get_viewbox_transform
def apply_transforms(path, node):
+ transform = get_node_transform(node)
+
+ # apply the combined transform to this node's path
+ simpletransform.applyTransformToPath(transform, path)
+
+ return path
+
+def get_node_transform(node):
# start with the identity transform
transform = [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]]
@@ -14,7 +22,4 @@ def apply_transforms(path, node):
viewbox_transform = get_viewbox_transform(node.getroottree().getroot())
transform = simpletransform.composeTransform(viewbox_transform, transform)
- # apply the combined transform to this node's path
- simpletransform.applyTransformToPath(transform, path)
-
- return path
+ return transform
diff --git a/lib/svg/tags.py b/lib/svg/tags.py
index 5488608c..7eb87540 100644
--- a/lib/svg/tags.py
+++ b/lib/svg/tags.py
@@ -12,6 +12,7 @@ INKSCAPE_LABEL = inkex.addNS('label', 'inkscape')
INKSCAPE_GROUPMODE = inkex.addNS('groupmode', 'inkscape')
CONNECTION_START = inkex.addNS('connection-start', 'inkscape')
CONNECTION_END = inkex.addNS('connection-end', 'inkscape')
+CONNECTOR_TYPE = inkex.addNS('connector-type', 'inkscape')
XLINK_HREF = inkex.addNS('href', 'xlink')
EMBROIDERABLE_TAGS = (SVG_PATH_TAG, SVG_POLYLINE_TAG)