Merge pull request #2133 from inkstitch/lexelby/reverse-one-rail

add reverse one rail param
pull/1886/head
Lex Neva 2023-03-11 15:56:45 -05:00 zatwierdzone przez GitHub
commit 383a51f328
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 20 dodań i 2 usunięć

Wyświetl plik

@ -210,6 +210,17 @@ class SatinColumn(EmbroideryElement):
# wider than we desire the column to end up.
return self.get_split_mm_param_as_px("pull_compensation_mm", (0, 0))
@property
@param(
'reverse_one_rail',
_('Reverse one rail'),
tooltip=_('Enabling this may help if your satin renders very strangely.'),
type='boolean',
default='false',
sort_index=10)
def reverse_one_rail(self):
return self.get_boolean_param('reverse_one_rail', False)
@property
@param(
'swap_satin_rails',
@ -217,7 +228,8 @@ class SatinColumn(EmbroideryElement):
tooltip=_('Swaps the first and second rails of the satin column, '
'affecting which side the thread finished on as well as any sided properties'),
type='boolean',
default='false')
default='false',
sort_index=11)
def swap_rails(self):
return self.get_boolean_param('swap_satin_rails', False)
@ -381,7 +393,12 @@ class SatinColumn(EmbroideryElement):
@cache
def flattened_rails(self):
"""The rails, as LineStrings."""
return tuple(shgeo.LineString(self.flatten_subpath(rail)) for rail in self.rails)
paths = [shgeo.LineString(self.flatten_subpath(rail)) for rail in self.rails]
if paths and self.reverse_one_rail:
paths[0] = shgeo.LineString(paths[0].coords[::-1])
return tuple(paths)
@property
@cache

Wyświetl plik

@ -120,6 +120,7 @@ inkstitch_attribs = [
'short_stitch_distance_mm',
'short_stitch_inset',
'running_stitch_length_mm',
'reverse_one_rail',
'swap_satin_rails',
'center_walk_underlay',
'center_walk_underlay_stitch_length_mm',