summaryrefslogtreecommitdiff
path: root/lib/elements
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2025-03-02 20:54:56 +0100
committerGitHub <noreply@github.com>2025-03-02 20:54:56 +0100
commitdc23265d2d2619ef6cb1c701480fc4ba10fafc77 (patch)
treecd3f13c3f1b1dcc06704136cea9b9a00a7b70656 /lib/elements
parent70d2ea52c412eb983a6d6037f1bb0ec1258196c1 (diff)
Use symbol as command position (#3542)
Diffstat (limited to 'lib/elements')
-rw-r--r--lib/elements/fill_stitch.py9
-rw-r--r--lib/elements/stroke.py8
2 files changed, 5 insertions, 12 deletions
diff --git a/lib/elements/fill_stitch.py b/lib/elements/fill_stitch.py
index 03a8e154..939d42d0 100644
--- a/lib/elements/fill_stitch.py
+++ b/lib/elements/fill_stitch.py
@@ -7,7 +7,7 @@ import math
import re
import numpy as np
-from inkex import LinearGradient, Transform
+from inkex import LinearGradient
from shapely import geometry as shgeo
from shapely import set_precision
from shapely.errors import GEOSException
@@ -22,7 +22,7 @@ from ..stitches import (auto_fill, circular_fill, contour_fill, guided_fill,
legacy_fill, linear_gradient_fill, meander_fill,
tartan_fill)
from ..stitches.linear_gradient_fill import gradient_angle
-from ..svg import PIXELS_PER_MM, get_node_transform
+from ..svg import PIXELS_PER_MM
from ..svg.clip import get_clip_path
from ..svg.tags import INKSCAPE_LABEL
from ..tartan.utils import get_tartan_settings, get_tartan_stripes
@@ -1196,10 +1196,7 @@ class FillStitch(EmbroideryElement):
# get target position
command = self.get_command('target_point')
if command:
- pos = [float(command.use.get("x", 0)), float(command.use.get("y", 0))]
- transform = get_node_transform(command.use)
- pos = Transform(transform).apply_to_point(pos)
- target = shgeo.Point(*pos)
+ target = shgeo.Point(*command.target_point)
else:
target = shape.centroid
stitches = circular_fill(
diff --git a/lib/elements/stroke.py b/lib/elements/stroke.py
index 14501c87..96a9307f 100644
--- a/lib/elements/stroke.py
+++ b/lib/elements/stroke.py
@@ -6,7 +6,6 @@
from math import ceil
import shapely.geometry as shgeo
-from inkex import Transform
from shapely.errors import GEOSException
from ..i18n import _
@@ -15,7 +14,7 @@ from ..stitch_plan import StitchGroup
from ..stitches.ripple_stitch import ripple_stitch
from ..stitches.running_stitch import (bean_stitch, running_stitch,
zigzag_stitch)
-from ..svg import get_node_transform, parse_length_with_units
+from ..svg import parse_length_with_units
from ..svg.clip import get_clip_path
from ..threads import ThreadColor
from ..utils import Point, cache
@@ -542,10 +541,7 @@ class Stroke(EmbroideryElement):
def get_ripple_target(self):
command = self.get_command('target_point')
if command:
- pos = [float(command.use.get("x", 0)), float(command.use.get("y", 0))]
- transform = get_node_transform(command.use)
- pos = Transform(transform).apply_to_point(pos)
- return Point(*pos)
+ return shgeo.Point(*command.target_point)
else:
return self.shape.centroid