diff --git a/pathscatter.inx b/pathscatter.inx index 4d54e81c1b2a84ac9b493d1ba64ff9b665f77522..41b66e10a1fe25c43d97786fac4a30b07fca62c9 100644 --- a/pathscatter.inx +++ b/pathscatter.inx @@ -9,7 +9,7 @@ false 0.0 0.0 - 0.0 + 0.0 false diff --git a/pathscatter.py b/pathscatter.py index c5cbfd1b4427c523f0409462119c2dc4cf9cb2c4..08e73ee858f124b3fa836e953a3fc3e2b80a1adf 100755 --- a/pathscatter.py +++ b/pathscatter.py @@ -83,7 +83,7 @@ class PathScatter(pathmodifier.Diffeo): bbox = BoundingBox(-bbox.y, -bbox.x) mat = Transform([[0, -1, 0], [1, 0, 0]]) * mat mat.add_translate([0, self.options.noffset]) - node.transform *= mat + node.transform = mat * node.transform return bbox def effect(self): @@ -141,11 +141,11 @@ class PathScatter(pathmodifier.Diffeo): length = sum(lengths) dx = width + self.options.space if self.options.stretch: - n = int((length - self.options.toffset + self.options.space) / dx) + n = int(length / dx + self.options.space) if n > 0: - dx = (length - self.options.toffset) / n + dx = (length) / n - s = self.options.toffset + s = 0 if self.options.stretch else self.options.toffset * 0.01 * dx while s <= length: local_transform = self.localTransformAt(s, skelcomp, lengths, skel_closed, \ self.options.follow) diff --git a/tests/data/refs/pathscatter__--id__g12668__--id__path8143__--stretch__False__--follow__False.out b/tests/data/refs/pathscatter__--id__g12668__--id__path8143__--stretch__False__--follow__False.out index 5693f81516aa0ac3f08820a638906f63825c7892..f8d0f712717a6c20f18e5d03259ddb2d10959cd1 100644 --- a/tests/data/refs/pathscatter__--id__g12668__--id__path8143__--stretch__False__--follow__False.out +++ b/tests/data/refs/pathscatter__--id__g12668__--id__path8143__--stretch__False__--follow__False.out @@ -1,6 +1,6 @@ - + - + @@ -11,71 +11,148 @@ - + - - - + + + - + - - - + + + - + - - - + + + - + - - - + + + - + - - - + + + - + - - - + + + - + - - - + + + - + - - - + + + - + - - - + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/data/refs/pathscatter__--id__g12668__--id__path8143__--stretch__True__--copymode__copy__--grouppick__True__--pickmode__seq.out b/tests/data/refs/pathscatter__--id__g12668__--id__path8143__--stretch__True__--copymode__copy__--grouppick__True__--pickmode__seq.out index 9aff6bf35d0fbf0728ec674359d17b08ffda3efa..0bf037eb89ecd9c25ea66e5c8231391cf94438e8 100644 --- a/tests/data/refs/pathscatter__--id__g12668__--id__path8143__--stretch__True__--copymode__copy__--grouppick__True__--pickmode__seq.out +++ b/tests/data/refs/pathscatter__--id__g12668__--id__path8143__--stretch__True__--copymode__copy__--grouppick__True__--pickmode__seq.out @@ -1,6 +1,6 @@ - + - + @@ -11,32 +11,52 @@ - - - - + + + + - + - - + + - - - + + + - - - + + + - - - + + + - - - + + + - + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tests/data/refs/pathscatter__--id__g12668__--id__path8143__--stretch__True__--rotate__True__--copymode__clone.out b/tests/data/refs/pathscatter__--id__g12668__--id__path8143__--stretch__True__--rotate__True__--copymode__clone.out index f4a0453588894d5665650a21acd27c5a148693ae..cac8ad16695b1735087432f87653bc6fd546eb06 100644 --- a/tests/data/refs/pathscatter__--id__g12668__--id__path8143__--stretch__True__--rotate__True__--copymode__clone.out +++ b/tests/data/refs/pathscatter__--id__g12668__--id__path8143__--stretch__True__--rotate__True__--copymode__clone.out @@ -1,6 +1,6 @@ - + - + @@ -11,14 +11,14 @@ - - - - + + + + - + - + \ No newline at end of file diff --git a/tests/data/refs/pathscatter__--id__path3990__--id__path3982__--stretch__True__--follow__True__--copymode__copy.out b/tests/data/refs/pathscatter__--id__path3990__--id__path3982__--stretch__True__--follow__True__--copymode__copy.out index 5c27addae4312649081b13404723bb2495cd2ea7..6f1ecf58fff36754704c8f4ee97d17c67573d358 100644 --- a/tests/data/refs/pathscatter__--id__path3990__--id__path3982__--stretch__True__--follow__True__--copymode__copy.out +++ b/tests/data/refs/pathscatter__--id__path3990__--id__path3982__--stretch__True__--follow__True__--copymode__copy.out @@ -1,6 +1,6 @@ - + - + @@ -12,14 +12,14 @@ - - - + + + - + - - + + @@ -61,5 +61,5 @@ - + \ No newline at end of file diff --git a/tests/data/svg/scatter.svg b/tests/data/svg/scatter.svg index e2ac00a16614ae6c2dc0505ba2cfa6ccc9adca44..0a3ff5d3b0935ce940a8720cb8f62ca30babfaa1 100644 --- a/tests/data/svg/scatter.svg +++ b/tests/data/svg/scatter.svg @@ -1,19 +1,19 @@ + viewBox="0 0 210 297" + version="1.1" + id="svg8" + sodipodi:docname="scatter.svg" + inkscape:version="1.1-rc (52f87abb86, 2021-05-02)" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:dc="http://purl.org/dc/elements/1.1/"> + id="base" + objecttolerance="10.0" + gridtolerance="10.0" + guidetolerance="10.0" + inkscape:pagecheckerboard="0" /> @@ -43,7 +47,7 @@ image/svg+xml - + @@ -59,14 +63,15 @@ style="fill:none;stroke:#000000;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" /> + transform="matrix(0.41480048,0.30168733,-0.26562825,0.47110973,136.76388,-111.50467)" + style="stroke-width:1.90501"> + style="stroke-width:4.97366">