[gimp] app: use gimp_paint_tool_set_draw_circle() in the MyPaint brush tool
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: use gimp_paint_tool_set_draw_circle() in the MyPaint brush tool
- Date: Mon, 30 Mar 2015 20:50:00 +0000 (UTC)
commit dd767bca37be8e2399effe31ca657d42554024a0
Author: Michael Natterer <mitch gimp org>
Date: Wed Apr 9 15:41:56 2014 +0200
app: use gimp_paint_tool_set_draw_circle() in the MyPaint brush tool
app/tools/gimpmybrushtool.c | 19 +++++++++++++++++++
app/tools/gimpmybrushtool.h | 2 ++
2 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/app/tools/gimpmybrushtool.c b/app/tools/gimpmybrushtool.c
index 678d137..406bd64 100644
--- a/app/tools/gimpmybrushtool.c
+++ b/app/tools/gimpmybrushtool.c
@@ -20,6 +20,7 @@
#include <gegl.h>
#include <gtk/gtk.h>
+#include "libgimpmath/gimpmath.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "tools-types.h"
@@ -40,6 +41,9 @@ G_DEFINE_TYPE (GimpMybrushTool, gimp_mybrush_tool, GIMP_TYPE_PAINT_TOOL)
#define parent_class gimp_mybrush_tool_parent_class
+static void gimp_mybrush_tool_draw (GimpDrawTool *draw_tool);
+
+
void
gimp_mybrush_tool_register (GimpToolRegisterCallback callback,
gpointer data)
@@ -63,6 +67,9 @@ gimp_mybrush_tool_register (GimpToolRegisterCallback callback,
static void
gimp_mybrush_tool_class_init (GimpMybrushToolClass *klass)
{
+ GimpDrawToolClass *draw_tool_class = GIMP_DRAW_TOOL_CLASS (klass);
+
+ draw_tool_class->draw = gimp_mybrush_tool_draw;
}
static void
@@ -75,3 +82,15 @@ gimp_mybrush_tool_init (GimpMybrushTool *mybrush_tool)
gimp_paint_tool_enable_color_picker (GIMP_PAINT_TOOL (mybrush_tool),
GIMP_COLOR_PICK_MODE_FOREGROUND);
}
+
+static void
+gimp_mybrush_tool_draw (GimpDrawTool *draw_tool)
+{
+ GimpPaintTool *paint_tool = GIMP_PAINT_TOOL (draw_tool);
+ GimpMybrushOptions *options = GIMP_MYBRUSH_TOOL_GET_OPTIONS (draw_tool);
+
+ gimp_paint_tool_set_draw_circle (paint_tool, TRUE,
+ exp (options->radius));
+
+ GIMP_DRAW_TOOL_CLASS (parent_class)->draw (draw_tool);
+}
diff --git a/app/tools/gimpmybrushtool.h b/app/tools/gimpmybrushtool.h
index f4413cb..15ed40f 100644
--- a/app/tools/gimpmybrushtool.h
+++ b/app/tools/gimpmybrushtool.h
@@ -29,6 +29,8 @@
#define GIMP_IS_MYBRUSH_TOOL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GIMP_TYPE_MYBRUSH_TOOL))
#define GIMP_MYBRUSH_TOOL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GIMP_TYPE_MYBRUSH_TOOL,
GimpMybrushToolClass))
+#define GIMP_MYBRUSH_TOOL_GET_OPTIONS(t) (GIMP_MYBRUSH_OPTIONS (gimp_tool_get_options (GIMP_TOOL (t))))
+
typedef struct _GimpMybrushTool GimpMybrushTool;
typedef struct _GimpMybrushToolClass GimpMybrushToolClass;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]