summaryrefslogtreecommitdiff
path: root/lib/elements/element.py
diff options
context:
space:
mode:
authorKaalleen <36401965+kaalleen@users.noreply.github.com>2024-03-29 10:25:02 +0100
committerGitHub <noreply@github.com>2024-03-29 10:25:02 +0100
commit2439adafa8592995d9acead47ef2802d5d95c373 (patch)
treebfa10aaf017bc48cf6c166c7adeb9afd5dc12922 /lib/elements/element.py
parentfb1ecd0badf5eb142f17cc7f0f7e8b347151b002 (diff)
Add "the tartan universe" (#2782)
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 071f8a90..4ea909ac 100644
--- a/lib/elements/element.py
+++ b/lib/elements/element.py
@@ -22,7 +22,7 @@ from ..svg import (PIXELS_PER_MM, apply_transforms, convert_length,
get_node_transform)
from ..svg.tags import INKSCAPE_LABEL, INKSTITCH_ATTRIBS
from ..utils import Point, cache
-from ..utils.cache import get_stitch_plan_cache, CacheKeyGenerator
+from ..utils.cache import CacheKeyGenerator, get_stitch_plan_cache
class Param(object):
@@ -557,6 +557,9 @@ class EmbroideryElement(object):
gradient['styles'] = [(style['stop-color'], style['stop-opacity']) for style in self.gradient.stop_styles]
return gradient
+ def _get_tartan_key_data(self):
+ return (self.node.get('inkstitch:tartan', None))
+
def get_cache_key_data(self, previous_stitch):
return []
@@ -572,6 +575,7 @@ class EmbroideryElement(object):
cache_key_generator.update(self._get_patterns_cache_key_data())
cache_key_generator.update(self._get_guides_cache_key_data())
cache_key_generator.update(self.get_cache_key_data(previous_stitch))
+ cache_key_generator.update(self._get_tartan_key_data())
cache_key = cache_key_generator.get_cache_key()
debug.log(f"cache key for {self.node.get('id')} {self.node.get(INKSCAPE_LABEL)} {previous_stitch}: {cache_key}")