From fc8f1d0aae42ab1394c5a09df07569013a92438f Mon Sep 17 00:00:00 2001 From: Kaalleen <36401965+kaalleen@users.noreply.github.com> Date: Mon, 28 Dec 2020 07:12:26 +0100 Subject: [PATCH] Prevent Auto Route Satin Without Satin Columns (#942) --- lib/extensions/auto_satin.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/extensions/auto_satin.py b/lib/extensions/auto_satin.py index b7cee83bc..14fa17584 100644 --- a/lib/extensions/auto_satin.py +++ b/lib/extensions/auto_satin.py @@ -2,6 +2,7 @@ import sys import inkex +from ..elements import SatinColumn from ..i18n import _ from ..stitches.auto_satin import auto_satin from .commands import CommandsExtension @@ -43,6 +44,11 @@ class AutoSatin(CommandsExtension): inkex.errormsg(_("Please select one or more satin columns.")) return False + satincolumns = [element for element in self.elements if isinstance(element, SatinColumn)] + if len(satincolumns) == 0: + inkex.errormsg(_("Please select at least one satin column.")) + return False + return True def effect(self): @@ -51,4 +57,8 @@ class AutoSatin(CommandsExtension): starting_point = self.get_starting_point() ending_point = self.get_ending_point() - auto_satin(self.elements, self.options.preserve_order, starting_point, ending_point, self.options.trim) + + # Ignore fills + elements = [element for element in self.elements if isinstance(element, SatinColumn) or isinstance(element, Stroke)] + + auto_satin(elements, self.options.preserve_order, starting_point, ending_point, self.options.trim)