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.
This commit is contained in:
Michael Natterer 2014-04-09 15:26:10 +02:00
parent 703c2c78c4
commit e3a98eade2
2 changed files with 20 additions and 0 deletions

View File

@ -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);
}

View File

@ -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;