[gimp] app: use gimp_paint_tool_set_draw_circle() in the ink tool



commit e3a98eade2217ff24aa9930cf8747b5aaaa5f19f
Author: Michael Natterer <mitch gimp org>
Date:   Wed Apr 9 15:26:10 2014 +0200

    app: use gimp_paint_tool_set_draw_circle() in the ink tool
    
    so we get at least a rough preview of where the paint will go.

 app/tools/gimpinktool.c |   18 ++++++++++++++++++
 app/tools/gimpinktool.h |    2 ++
 2 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/app/tools/gimpinktool.c b/app/tools/gimpinktool.c
index 49c5b1f..58474e5 100644
--- a/app/tools/gimpinktool.c
+++ b/app/tools/gimpinktool.c
@@ -40,6 +40,9 @@ G_DEFINE_TYPE (GimpInkTool, gimp_ink_tool, GIMP_TYPE_PAINT_TOOL)
 #define parent_class gimp_ink_tool_parent_class
 
 
+static void   gimp_ink_tool_draw (GimpDrawTool *draw_tool);
+
+
 void
 gimp_ink_tool_register (GimpToolRegisterCallback  callback,
                         gpointer                  data)
@@ -63,6 +66,9 @@ gimp_ink_tool_register (GimpToolRegisterCallback  callback,
 static void
 gimp_ink_tool_class_init (GimpInkToolClass *klass)
 {
+  GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
+
+  draw_tool_class->draw = gimp_ink_tool_draw;
 }
 
 static void
@@ -81,3 +87,15 @@ gimp_ink_tool_init (GimpInkTool *ink_tool)
   gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (ink_tool),
                                        GIMP_COLOR_PICK_MODE_FOREGROUND);
 }
+
+static void
+gimp_ink_tool_draw (GimpDrawTool *draw_tool)
+{
+  GimpPaintTool  *paint_tool = GIMP_PAINT_TOOL (draw_tool);
+  GimpInkOptions *options    = GIMP_INK_TOOL_GET_OPTIONS (draw_tool);
+
+  gimp_paint_tool_set_draw_circle (paint_tool, TRUE,
+                                   options->size);
+
+  GIMP_DRAW_TOOL_CLASS (parent_class)->draw (draw_tool);
+}
diff --git a/app/tools/gimpinktool.h b/app/tools/gimpinktool.h
index 955ac19..c4ecd0f 100644
--- a/app/tools/gimpinktool.h
+++ b/app/tools/gimpinktool.h
@@ -29,6 +29,8 @@
 #define GIMP_IS_INK_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_INK_TOOL))
 #define GIMP_INK_TOOL_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_INK_TOOL, 
GimpInkToolClass))
 
+#define GIMP_INK_TOOL_GET_OPTIONS(t)  (GIMP_INK_OPTIONS (gimp_tool_get_options (GIMP_TOOL (t))))
+
 
 typedef struct _GimpInkTool      GimpInkTool;
 typedef struct _GimpInkToolClass GimpInkToolClass;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]