summaryrefslogtreecommitdiff
path: root/lib/extensions
diff options
context:
space:
mode:
Diffstat (limited to 'lib/extensions')
-rw-r--r--lib/extensions/convert_to_satin.py27
-rw-r--r--lib/extensions/params.py16
2 files changed, 23 insertions, 20 deletions
diff --git a/lib/extensions/convert_to_satin.py b/lib/extensions/convert_to_satin.py
index ef4ac557..2b586e36 100644
--- a/lib/extensions/convert_to_satin.py
+++ b/lib/extensions/convert_to_satin.py
@@ -1,17 +1,18 @@
-import inkex
-from shapely import geometry as shgeo
+from copy import deepcopy
from itertools import chain, groupby
-import numpy
-from numpy import diff, sign, setdiff1d
import math
-from copy import deepcopy
-from .base import InkstitchExtension
-from ..svg.tags import SVG_PATH_TAG
-from ..svg import get_correction_transform, PIXELS_PER_MM
+import inkex
+from numpy import diff, sign, setdiff1d
+import numpy
+from shapely import geometry as shgeo
+
from ..elements import Stroke
-from ..utils import Point
from ..i18n import _
+from ..svg import get_correction_transform, PIXELS_PER_MM
+from ..svg.tags import SVG_PATH_TAG
+from ..utils import Point
+from .base import InkstitchExtension
class SelfIntersectionError(Exception):
@@ -112,10 +113,10 @@ class ConvertToSatin(InkstitchExtension):
if not isinstance(left_rail, shgeo.LineString) or \
not isinstance(right_rail, shgeo.LineString):
- # If the parallel offsets come out as anything but a LineString, that means the
- # path intersects itself, when taking its stroke width into consideration. See
- # the last example for parallel_offset() in the Shapely documentation:
- # https://shapely.readthedocs.io/en/latest/manual.html#object.parallel_offset
+ # If the parallel offsets come out as anything but a LineString, that means the
+ # path intersects itself, when taking its stroke width into consideration. See
+ # the last example for parallel_offset() in the Shapely documentation:
+ # https://shapely.readthedocs.io/en/latest/manual.html#object.parallel_offset
raise SelfIntersectionError()
# for whatever reason, shapely returns a right-side offset's coordinates in reverse
diff --git a/lib/extensions/params.py b/lib/extensions/params.py
index d3cb154a..4d04ba23 100644
--- a/lib/extensions/params.py
+++ b/lib/extensions/params.py
@@ -6,6 +6,7 @@ from itertools import groupby
import os
import sys
+
import wx
from wx.lib.scrolledpanel import ScrolledPanel
@@ -460,15 +461,16 @@ class Params(InkstitchExtension):
element = EmbroideryElement(node)
classes = []
- if element.get_style("fill"):
- classes.append(AutoFill)
- classes.append(Fill)
+ if not is_command(node):
+ if element.get_style("fill", "black") is not None:
+ classes.append(AutoFill)
+ classes.append(Fill)
- if element.get_style("stroke") and not is_command(node):
- classes.append(Stroke)
+ if element.get_style("stroke") is not None:
+ classes.append(Stroke)
- if element.get_style("stroke-dasharray") is None:
- classes.append(SatinColumn)
+ if element.get_style("stroke-dasharray") is None:
+ classes.append(SatinColumn)
return classes