summaryrefslogtreecommitdiff
path: root/lib/stitches
diff options
context:
space:
mode:
Diffstat (limited to 'lib/stitches')
-rw-r--r--lib/stitches/guided_fill.py2
-rw-r--r--lib/stitches/linear_gradient_fill.py7
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/stitches/guided_fill.py b/lib/stitches/guided_fill.py
index 5d9a6018..16f0f2e8 100644
--- a/lib/stitches/guided_fill.py
+++ b/lib/stitches/guided_fill.py
@@ -180,7 +180,7 @@ def apply_stitches(line, max_stitch_length, num_staggers, row_spacing, row_num,
# corners.
if not threshold:
threshold = row_spacing / 2.0
- simplified_line = line.simplify(threshold, False)
+ simplified_line = line.simplify(threshold, preserve_topology=False)
simplified_points = [shgeo.Point(x, y) for x, y in simplified_line.coords]
extra_points = []
diff --git a/lib/stitches/linear_gradient_fill.py b/lib/stitches/linear_gradient_fill.py
index 2fb03bf9..589a1f23 100644
--- a/lib/stitches/linear_gradient_fill.py
+++ b/lib/stitches/linear_gradient_fill.py
@@ -6,7 +6,7 @@
from math import ceil, floor, sqrt
import numpy as np
-from inkex import DirectedLineSegment, Transform
+from inkex import Color, ColorError, DirectedLineSegment, Transform
from networkx import is_empty
from shapely import segmentize
from shapely.affinity import rotate
@@ -75,7 +75,10 @@ def _get_gradient_info(fill, bbox):
# but inkex/tinycss fails on stop color styles when it is not in the style attribute, but in it's own stop-color attribute
colors = []
for i, stop in enumerate(fill.gradient.stops):
- color = stop.get_computed_style('stop-color')
+ try:
+ color = stop.get_computed_style('stop-color')
+ except ColorError:
+ color = Color('black')
opacity = stop.get_computed_style('stop-opacity')
if float(opacity) == 0:
color = 'none'