diff options
| author | Kaalleen <36401965+kaalleen@users.noreply.github.com> | 2024-08-21 15:19:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-21 15:19:14 +0200 |
| commit | 47893d52577a10143b51e27ea3addaa5425458ff (patch) | |
| tree | e6297a1d90e456df73549e5f36644340288a8bf2 /lib | |
| parent | 07f98b0a9b0e5315a2bc83bfa8ab8b6dbd9eaf2b (diff) | |
multicolor satin: option to adjust underlay (#3152)
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/gui/satin_multicolor/colorize_panel.py | 10 | ||||
| -rw-r--r-- | lib/gui/satin_multicolor/main_panel.py | 17 |
2 files changed, 26 insertions, 1 deletions
diff --git a/lib/gui/satin_multicolor/colorize_panel.py b/lib/gui/satin_multicolor/colorize_panel.py index 2dc10673..d521bf2f 100644 --- a/lib/gui/satin_multicolor/colorize_panel.py +++ b/lib/gui/satin_multicolor/colorize_panel.py @@ -64,6 +64,11 @@ class ColorizePanel(ScrolledPanel): self.keep_original = wx.CheckBox(self) self.keep_original.SetValue(True) + adjust_underlay_per_color_label = wx.StaticText(self, label=_("Adjust underlay per color")) + self.adjust_underlay_per_color = wx.CheckBox(self) + self.adjust_underlay_per_color.Bind(wx.EVT_CHECKBOX, self._update_underlay) + equististance_label.SetToolTip(_("When disabled existing underlay is applied only to the first color.")) + # Colors color_settings_headline = wx.StaticText(self, label=_("Colors")) color_settings_headline.SetFont(wx.Font().Bold()) @@ -89,6 +94,8 @@ class ColorizePanel(ScrolledPanel): general_settings_sizer.Add(self.seed, 0, wx.ALL | wx.EXPAND, 0) general_settings_sizer.Add(keep_original_label, 0, wx.TOP, 30) general_settings_sizer.Add(self.keep_original, 0, wx.TOP | wx.EXPAND, 30) + general_settings_sizer.Add(adjust_underlay_per_color_label, 0, wx.ALL, 0) + general_settings_sizer.Add(self.adjust_underlay_per_color, 0, wx.ALL | wx.EXPAND, 0) general_settings_sizer.AddGrowableCol(1) color_header_sizer.Add(color_settings_headline, 0, wx.ALL, 10) @@ -238,3 +245,6 @@ class ColorizePanel(ScrolledPanel): self.monochrome_width.SetMax(max_width) self.Refresh() self._update() + + def _update_underlay(self, event): + self.panel.update_preview() diff --git a/lib/gui/satin_multicolor/main_panel.py b/lib/gui/satin_multicolor/main_panel.py index 197e197c..c27372b3 100644 --- a/lib/gui/satin_multicolor/main_panel.py +++ b/lib/gui/satin_multicolor/main_panel.py @@ -165,13 +165,28 @@ class MultiColorSatinPanel(wx.Panel): new_satin.set('inkstitch:swap_satin_rails', False) new_satin.set('inkstitch:random_width_increase_percent', f'{ margin } 0') new_satin.set('inkstitch:random_width_decrease_percent', f'0 { -previous_margin }') - new_satin.set('inkstitch:pull_compensation_percent', f'{ current_position + width - 100} { -current_position }') + new_satin.set('inkstitch:pull_compensation_percent', f'{ current_position + width - 100} { -current_position }') else: new_satin.set('inkstitch:swap_satin_rails', True) new_satin.set('inkstitch:random_width_increase_percent', f'0 { margin }') new_satin.set('inkstitch:random_width_decrease_percent', f'{ -previous_margin } 0') new_satin.set('inkstitch:pull_compensation_percent', f'{ -current_position } { current_position + width - 100}') + # underlay + if self.colorize_panel.adjust_underlay_per_color.GetValue(): + if i % 2 == 0: + new_satin.set('inkstitch:center_walk_underlay_position', f'{ 100 - current_position - width / 2 }') + new_satin.set('inkstitch:contour_underlay_inset_percent', f'{ 100 - current_position - width } { current_position }') + new_satin.set('inkstitch:zigzag_underlay_inset_percent', f'{ 100 - current_position - width} { current_position }') + else: + new_satin.set('inkstitch:center_walk_underlay_position', f'{ current_position + width / 2 }') + new_satin.set('inkstitch:contour_underlay_inset_percent', f'{ current_position } { 100 - current_position - width }') + new_satin.set('inkstitch:zigzag_underlay_inset_percent', f'{ current_position } { 100 - current_position - width }') + elif i > 0: + new_satin.set('inkstitch:center_walk_underlay', False) + new_satin.set('inkstitch:contour_underlay', False) + new_satin.set('inkstitch:zigzag_underlay', False) + previous_margin = margin current_position += width + margin |
