diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2018-06-29 21:26:03 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-06-29 21:26:03 -0400 |
| commit | 4d7b07ff02e13f237fac8eb8715fe4a6324ea6dc (patch) | |
| tree | f1c29df5f29d5bfefb48513043116b73209f202d /lib/svg/path.py | |
| parent | 7c8cd648a36e10e5ebfb94ce27be76e5ba47f334 (diff) | |
| parent | de4ead1ad467997fa81a4459e194769dfab185e2 (diff) | |
Merge pull request #212 from inkstitch/lexelby-fill-markers
fill start/end
Diffstat (limited to 'lib/svg/path.py')
| -rw-r--r-- | lib/svg/path.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/svg/path.py b/lib/svg/path.py new file mode 100644 index 00000000..a8012774 --- /dev/null +++ b/lib/svg/path.py @@ -0,0 +1,20 @@ +import simpletransform +import cubicsuperpath + +from .units import get_viewbox_transform + +def apply_transforms(path, node): + # start with the identity transform + transform = [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]] + + # combine this node's transform with all parent groups' transforms + transform = simpletransform.composeParents(node, transform) + + # add in the transform implied by the viewBox + 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 |
