summaryrefslogtreecommitdiff
path: root/lib/elements/element.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2025-10-22 18:04:41 +0200
committerGitHub <noreply@github.com>2025-10-22 18:04:41 +0200
commitf5a7a2b6358aa767ae65578ff622c9856d78589f (patch)
treef2ba99deca3fbca79d78f9ce1401a42eb189d492 /lib/elements/element.py
parent217c7853c88bc3d70d13a71bb72ed57c70881af5 (diff)
Gradient color: fix cache key error (#4007)
* use first stop color for non linear gradient fill objects * fix bug in get_cache_key for gradient objects
Diffstat (limited to 'lib/elements/element.py')
-rw-r--r--lib/elements/element.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/elements/element.py b/lib/elements/element.py
index 6b1ca47c..f1e6eb36 100644
--- a/lib/elements/element.py
+++ b/lib/elements/element.py
@@ -12,7 +12,7 @@ from typing import List, Optional
import inkex
import numpy as np
-from inkex import BaseElement, bezier
+from inkex import BaseElement, Color, bezier
from shapely import Point as ShapelyPoint
from shapely.ops import nearest_points
@@ -599,6 +599,10 @@ class EmbroideryElement(object):
stitch_plan_cache = get_stitch_plan_cache()
cache_key = self.get_cache_key(previous_stitch, next_element)
if cache_key not in stitch_plan_cache:
+ # fix up colors for cache
+ for stitch_group in stitch_groups:
+ if not isinstance(stitch_group.color, Color):
+ stitch_group.color = "black"
stitch_plan_cache[cache_key] = stitch_groups
if previous_stitch is not None: