[gimp/mypaint-brush: 7/9] app: make the mypaint tool brush outline size follow the settings instantly
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/mypaint-brush: 7/9] app: make the mypaint tool brush outline size follow the settings instantly
- Date: Wed, 19 Nov 2014 20:07:19 +0000 (UTC)
commit f799f876f77a63083bcce4362b030dd508ecc7cc
Author: Michael Natterer <mitch gimp org>
Date: Fri Jun 20 01:54:17 2014 +0200
app: make the mypaint tool brush outline size follow the settings instantly
app/tools/gimpmybrushtool.c | 21 +++++++++++++++++++++
1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/app/tools/gimpmybrushtool.c b/app/tools/gimpmybrushtool.c
index 5e31ac2..b6d5d5c 100644
--- a/app/tools/gimpmybrushtool.c
+++ b/app/tools/gimpmybrushtool.c
@@ -41,6 +41,10 @@ G_DEFINE_TYPE (GimpMybrushTool, gimp_mybrush_tool, GIMP_TYPE_PAINT_TOOL)
#define parent_class gimp_mybrush_tool_parent_class
+static void gimp_mybrush_tool_options_notify (GimpTool *tool,
+ GimpToolOptions *options,
+ const GParamSpec *pspec);
+
static GimpCanvasItem * gimp_mybrush_tool_get_outline (GimpPaintTool *paint_tool,
GimpDisplay *display,
gdouble x,
@@ -70,8 +74,11 @@ gimp_mybrush_tool_register (GimpToolRegisterCallback callback,
static void
gimp_mybrush_tool_class_init (GimpMybrushToolClass *klass)
{
+ GimpToolClass *tool_class = GIMP_TOOL_CLASS (klass);
GimpPaintToolClass *paint_tool_class = GIMP_PAINT_TOOL_CLASS (klass);
+ tool_class->options_notify = gimp_mybrush_tool_options_notify;
+
paint_tool_class->get_outline = gimp_mybrush_tool_get_outline;
}
@@ -88,6 +95,20 @@ gimp_mybrush_tool_init (GimpMybrushTool *mybrush_tool)
GIMP_COLOR_PICK_MODE_FOREGROUND);
}
+static void
+gimp_mybrush_tool_options_notify (GimpTool *tool,
+ GimpToolOptions *options,
+ const GParamSpec *pspec)
+{
+ GIMP_TOOL_CLASS (parent_class)->options_notify (tool, options, pspec);
+
+ if (! strcmp (pspec->name, "radius"))
+ {
+ gimp_draw_tool_pause (GIMP_DRAW_TOOL (tool));
+ gimp_draw_tool_resume (GIMP_DRAW_TOOL (tool));
+ }
+}
+
static GimpCanvasItem *
gimp_mybrush_tool_get_outline (GimpPaintTool *paint_tool,
GimpDisplay *display,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]