Add shape property to clone (#2637)

pull/2656/head
Kaalleen 2023-12-25 08:50:28 +01:00 zatwierdzone przez GitHub
rodzic 5daa3aa3f0
commit a001667470
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -6,6 +6,7 @@
from math import atan2, degrees, radians
from inkex import CubicSuperPath, Path, Transform
from shapely import MultiLineString
from ..commands import is_command_symbol
from ..i18n import _
@ -142,6 +143,14 @@ class Clone(EmbroideryElement):
center = self.node.bounding_box(transform).center
return center
@property
def shape(self):
path = self.node.get_path()
transform = Transform(self.node.composed_transform())
path = path.transform(transform)
path = path.to_superpath()
return MultiLineString(path)
def validation_warnings(self):
source_node = get_clone_source(self.node)
if source_node.tag not in EMBROIDERABLE_TAGS: