Skip to content

Commit

Permalink
on_options_changed method for filters, crop, skew (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
maoschanz committed Feb 17, 2023
1 parent 64a40b2 commit 501acdf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/tools/transform_tools/abstract_transform_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ def get_deformed_surface(self, source_surface, new_surface, coefs):
def on_options_changed(self):
super().on_options_changed()
self._update_expansion_rgba(self._last_btn)
self.build_and_do_op()

def _update_expansion_rgba(self, event_btn=1):
"""When the canvas grows, the color of the new pixels is parametrable"""
Expand Down
9 changes: 6 additions & 3 deletions src/tools/transform_tools/tool_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ def get_editing_tips(self):
tip_label = _("Click on the image to preview the selected filter")
return [self.type_label, tip_label]

def on_options_changed(self):
self._preview_filter()

############################################################################

def _set_blur_direction(self, *args):
Expand Down Expand Up @@ -138,7 +141,7 @@ def on_tool_selected(self, *args):
self._set_blur_direction()
GLib.timeout_add(100, self._async_open_menu, {})
if self.blur_algo == BlurType.INVALID:
self.on_filter_preview()
self._preview_filter()
else:
operation = self.build_operation()
operation['radius'] = 0
Expand All @@ -153,9 +156,9 @@ def _async_open_menu(self, *args):
return False

def on_press_on_area(self, event, surface, event_x, event_y):
self.on_filter_preview()
self._preview_filter()

def on_filter_preview(self, *args):
def _preview_filter(self, *args):
self._set_active_type()
self._set_blur_direction()
self.build_and_do_op()
Expand Down

0 comments on commit 501acdf

Please sign in to comment.