[gimp/blend-tool-fun: 8/12] app: Sync opacity and paint-mode properties with blend_tool->image_map
- From: Michael Henning <mhenning src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/blend-tool-fun: 8/12] app: Sync opacity and paint-mode properties with blend_tool->image_map
- Date: Mon, 30 Jun 2014 02:23:35 +0000 (UTC)
commit 800705d478a340870b9c3d368f47e954a1de0e5e
Author: Michael Henning <drawoc darkrefraction com>
Date: Tue Jun 24 15:17:45 2014 -0400
app: Sync opacity and paint-mode properties with blend_tool->image_map
app/tools/gimpblendtool.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/app/tools/gimpblendtool.c b/app/tools/gimpblendtool.c
index 9113b42..9b81ede 100644
--- a/app/tools/gimpblendtool.c
+++ b/app/tools/gimpblendtool.c
@@ -800,6 +800,7 @@ gimp_blend_tool_options_notify (GimpTool *tool,
GimpToolOptions *options,
const GParamSpec *pspec)
{
+ GimpContext *context = GIMP_CONTEXT (options);
GimpBlendTool *blend_tool = GIMP_BLEND_TOOL (tool);
/* Sync any property changes on the config object that match the op */
@@ -816,6 +817,16 @@ gimp_blend_tool_options_notify (GimpTool *tool,
gimp_image_map_apply (blend_tool->image_map, NULL);
}
+ else if (blend_tool->image_map &&
+ (! strcmp (pspec->name, "opacity") ||
+ ! strcmp (pspec->name, "paint-mode")))
+ {
+ gimp_image_map_set_mode (blend_tool->image_map,
+ gimp_context_get_opacity (context),
+ gimp_context_get_paint_mode (context));
+
+ gimp_image_map_apply (blend_tool->image_map, NULL);
+ }
}
/* Image map stuff */
@@ -824,6 +835,9 @@ static void
gimp_blend_tool_create_image_map (GimpBlendTool *blend_tool,
GimpDrawable *drawable)
{
+ GimpBlendOptions *options = GIMP_BLEND_TOOL_GET_OPTIONS (blend_tool);
+ GimpContext *context = GIMP_CONTEXT (options);
+
if (! blend_tool->graph)
gimp_blend_tool_create_graph (blend_tool);
@@ -838,6 +852,10 @@ gimp_blend_tool_create_image_map (GimpBlendTool *blend_tool,
g_signal_connect (blend_tool->image_map, "flush",
G_CALLBACK (gimp_blend_tool_image_map_flush),
blend_tool);
+
+ gimp_image_map_set_mode (blend_tool->image_map,
+ gimp_context_get_opacity (context),
+ gimp_context_get_paint_mode (context));
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]