Prevent Auto Route Satin Without Satin Columns (#942)

pull/993/head
Kaalleen 2020-12-28 07:12:26 +01:00 zatwierdzone przez GitHub
rodzic 41c25ffe14
commit fc8f1d0aae
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 11 dodań i 1 usunięć

Wyświetl plik

@ -2,6 +2,7 @@ import sys
import inkex import inkex
from ..elements import SatinColumn
from ..i18n import _ from ..i18n import _
from ..stitches.auto_satin import auto_satin from ..stitches.auto_satin import auto_satin
from .commands import CommandsExtension from .commands import CommandsExtension
@ -43,6 +44,11 @@ class AutoSatin(CommandsExtension):
inkex.errormsg(_("Please select one or more satin columns.")) inkex.errormsg(_("Please select one or more satin columns."))
return False 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 return True
def effect(self): def effect(self):
@ -51,4 +57,8 @@ class AutoSatin(CommandsExtension):
starting_point = self.get_starting_point() starting_point = self.get_starting_point()
ending_point = self.get_ending_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)