From bf42ef00ca315e78c0069c01d97517e3786f2135 Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Sat, 11 May 2024 08:14:40 +0200 Subject: Update inkex (#2892) * fix currentColor * fix pip inkex import * fix color block extension --- lib/elements/fill_stitch.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'lib/elements/fill_stitch.py') diff --git a/lib/elements/fill_stitch.py b/lib/elements/fill_stitch.py index 47155ce0..6bf52d95 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 Transform +from inkex import LinearGradient, Transform from shapely import geometry as shgeo from shapely.errors import GEOSException from shapely.ops import nearest_points @@ -588,9 +588,10 @@ class FillStitch(EmbroideryElement): @property def gradient(self): - color = self.color[5:-1] - xpath = f'.//svg:defs/svg:linearGradient[@id="{color}"]' - return self.node.getroottree().getroot().findone(xpath) + gradient = self.node.get_computed_style("fill") + if isinstance(gradient, LinearGradient): + return gradient + return None @property @param('fill_underlay', _('Underlay'), type='toggle', group=_('Fill Underlay'), default=True) -- cgit v1.2.3