[gimp/gimp-2-8] app: don't create a fallback crosshair in gimp_brush_tool_create_outline()
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-8] app: don't create a fallback crosshair in gimp_brush_tool_create_outline()
- Date: Wed, 9 Apr 2014 13:00:33 +0000 (UTC)
commit fb2ecd9f509f92fc6674dc0751bba889c8195b1e
Author: Michael Natterer <mitch gimp org>
Date: Wed Apr 9 14:30:46 2014 +0200
app: don't create a fallback crosshair in gimp_brush_tool_create_outline()
Instead, draw the crosshair in gimp_brush_tool_draw() if create_outline()
didn't return an item *and* if there is no brush tool cursor.
In gimp_source_tool_draw(), don't add an additional crosshair if
create_outline() returned an item.
This fixes both "no cursor at all" and "both outline and crosshair
shown" for certain prefs settings conbinations (bug #623734).
(cherry picked from commit e8459beb2448bcb526df429a944070169463aca5)
app/tools/gimpbrushtool.c | 26 ++++++++++++------------
app/tools/gimpbrushtool.h | 3 +-
app/tools/gimpsourcetool.c | 45 +++++++++++++++++++++++++++----------------
3 files changed, 42 insertions(+), 32 deletions(-)
---
diff --git a/app/tools/gimpbrushtool.c b/app/tools/gimpbrushtool.c
index a794415..1e3b95f 100644
--- a/app/tools/gimpbrushtool.c
+++ b/app/tools/gimpbrushtool.c
@@ -290,8 +290,18 @@ gimp_brush_tool_draw (GimpDrawTool *draw_tool)
item = gimp_brush_tool_create_outline (brush_tool,
draw_tool->display,
brush_tool->brush_x,
- brush_tool->brush_y,
- ! brush_tool->show_cursor);
+ brush_tool->brush_y);
+
+ if (! item && ! brush_tool->show_cursor)
+ {
+ item = gimp_canvas_handle_new (gimp_display_get_shell (draw_tool->display),
+ GIMP_HANDLE_CROSS,
+ GIMP_HANDLE_ANCHOR_CENTER,
+ brush_tool->brush_x,
+ brush_tool->brush_y,
+ GIMP_TOOL_HANDLE_SIZE_SMALL,
+ GIMP_TOOL_HANDLE_SIZE_SMALL);
+ }
if (item)
{
@@ -304,8 +314,7 @@ GimpCanvasItem *
gimp_brush_tool_create_outline (GimpBrushTool *brush_tool,
GimpDisplay *display,
gdouble x,
- gdouble y,
- gboolean draw_fallback)
+ gdouble y)
{
GimpBrushCore *brush_core;
GimpPaintOptions *options;
@@ -359,15 +368,6 @@ gimp_brush_tool_create_outline (GimpBrushTool *brush_tool,
return gimp_canvas_path_new (shell, boundary, x, y, FALSE,
GIMP_PATH_STYLE_OUTLINE);
}
- else if (draw_fallback)
- {
- return gimp_canvas_handle_new (shell,
- GIMP_HANDLE_CROSS,
- GIMP_HANDLE_ANCHOR_CENTER,
- x, y,
- GIMP_TOOL_HANDLE_SIZE_SMALL,
- GIMP_TOOL_HANDLE_SIZE_SMALL);
- }
return NULL;
}
diff --git a/app/tools/gimpbrushtool.h b/app/tools/gimpbrushtool.h
index 1067c8a..44db369 100644
--- a/app/tools/gimpbrushtool.h
+++ b/app/tools/gimpbrushtool.h
@@ -53,8 +53,7 @@ GType gimp_brush_tool_get_type (void) G_GNUC_CONST;
GimpCanvasItem * gimp_brush_tool_create_outline (GimpBrushTool *brush_tool,
GimpDisplay *display,
gdouble x,
- gdouble y,
- gboolean draw_fallback);
+ gdouble y);
#endif /* __GIMP_BRUSH_TOOL_H__ */
diff --git a/app/tools/gimpsourcetool.c b/app/tools/gimpsourcetool.c
index 561730f..17958ce 100644
--- a/app/tools/gimpsourcetool.c
+++ b/app/tools/gimpsourcetool.c
@@ -394,8 +394,7 @@ gimp_source_tool_draw (GimpDrawTool *draw_tool)
gimp_brush_tool_create_outline (GIMP_BRUSH_TOOL (source_tool),
source_tool->src_display,
source_tool->src_x + off_x,
- source_tool->src_y + off_y,
- FALSE);
+ source_tool->src_y + off_y);
if (source_tool->src_outline)
{
@@ -405,25 +404,37 @@ gimp_source_tool_draw (GimpDrawTool *draw_tool)
}
}
- if (! source_tool->src_handle)
+ if (source_tool->src_outline)
{
- source_tool->src_handle =
- gimp_canvas_handle_new (src_shell,
- GIMP_HANDLE_CROSS,
- GIMP_HANDLE_ANCHOR_CENTER,
- source_tool->src_x + off_x,
- source_tool->src_y + off_y,
- GIMP_TOOL_HANDLE_SIZE_CROSS,
- GIMP_TOOL_HANDLE_SIZE_CROSS);
- gimp_display_shell_add_tool_item (src_shell,
- source_tool->src_handle);
- g_object_unref (source_tool->src_handle);
+ if (source_tool->src_handle)
+ {
+ gimp_display_shell_remove_tool_item (src_shell,
+ source_tool->src_handle);
+ source_tool->src_handle = NULL;
+ }
}
else
{
- gimp_canvas_handle_set_position (source_tool->src_handle,
- source_tool->src_x + off_x,
- source_tool->src_y + off_y);
+ if (! source_tool->src_handle)
+ {
+ source_tool->src_handle =
+ gimp_canvas_handle_new (src_shell,
+ GIMP_HANDLE_CROSS,
+ GIMP_HANDLE_ANCHOR_CENTER,
+ source_tool->src_x + off_x,
+ source_tool->src_y + off_y,
+ GIMP_TOOL_HANDLE_SIZE_CROSS,
+ GIMP_TOOL_HANDLE_SIZE_CROSS);
+ gimp_display_shell_add_tool_item (src_shell,
+ source_tool->src_handle);
+ g_object_unref (source_tool->src_handle);
+ }
+ else
+ {
+ gimp_canvas_handle_set_position (source_tool->src_handle,
+ source_tool->src_x + off_x,
+ source_tool->src_y + off_y);
+ }
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]