[gimp] app: FG select: refresh the preview when matting options change
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: FG select: refresh the preview when matting options change
- Date: Sat, 19 Apr 2014 00:52:56 +0000 (UTC)
commit 6b10b0511a54287a130ec877e7027c9132532735
Author: Michael Natterer <mitch gimp org>
Date: Sat Apr 19 02:51:00 2014 +0200
app: FG select: refresh the preview when matting options change
app/tools/gimpforegroundselecttool.c | 37 +++++++++++++++++++++++++--------
1 files changed, 28 insertions(+), 9 deletions(-)
---
diff --git a/app/tools/gimpforegroundselecttool.c b/app/tools/gimpforegroundselecttool.c
index 1c6dd77..de52fe0 100644
--- a/app/tools/gimpforegroundselecttool.c
+++ b/app/tools/gimpforegroundselecttool.c
@@ -747,17 +747,36 @@ gimp_foreground_select_tool_options_notify (GimpTool *tool,
GimpToolOptions *options,
const GParamSpec *pspec)
{
+ GimpForegroundSelectTool *fg_select = GIMP_FOREGROUND_SELECT_TOOL (tool);
+ GimpForegroundSelectOptions *fg_options = GIMP_FOREGROUND_SELECT_OPTIONS (options);
+
+ if (! tool->display)
+ return;
+
if (! strcmp (pspec->name, "mask-color"))
{
- GimpForegroundSelectTool *fg_select = GIMP_FOREGROUND_SELECT_TOOL (tool);
-
- if (tool->display)
- {
- if (fg_select->state == MATTING_STATE_PAINT_TRIMAP)
- gimp_foreground_select_tool_set_trimap (fg_select, tool->display);
- else if (fg_select->state == MATTING_STATE_PREVIEW_MASK)
- gimp_foreground_select_tool_set_preview (fg_select, tool->display);
- }
+ if (fg_select->state == MATTING_STATE_PAINT_TRIMAP)
+ gimp_foreground_select_tool_set_trimap (fg_select, tool->display);
+ else if (fg_select->state == MATTING_STATE_PREVIEW_MASK)
+ gimp_foreground_select_tool_set_preview (fg_select, tool->display);
+ }
+ else if (! strcmp (pspec->name, "engine"))
+ {
+ if (fg_select->state == MATTING_STATE_PREVIEW_MASK)
+ gimp_foreground_select_tool_preview (fg_select, tool->display);
+ }
+ else if (! strcmp (pspec->name, "iterations"))
+ {
+ if (fg_options->engine == GIMP_MATTING_ENGINE_GLOBAL &&
+ fg_select->state == MATTING_STATE_PREVIEW_MASK)
+ gimp_foreground_select_tool_preview (fg_select, tool->display);
+ }
+ else if (! strcmp (pspec->name, "levels") ||
+ ! strcmp (pspec->name, "active-levels"))
+ {
+ if (fg_options->engine == GIMP_MATTING_ENGINE_LEVIN &&
+ fg_select->state == MATTING_STATE_PREVIEW_MASK)
+ gimp_foreground_select_tool_preview (fg_select, tool->display);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]