Only draw the rectangle when `Show selection' is `true', with the help of

2007-09-23  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimprectangleselecttool.c
	(gimp_rect_select_tool_draw): Only draw the rectangle when `Show
	selection' is `true', with the help of a new function
	gimp_rect_select_tool_selection_visible(). Fixes bug #474509.

svn path=/trunk/; revision=23621
This commit is contained in:
Martin Nordholts 2007-09-23 07:26:52 +00:00 committed by Martin Nordholts
parent cd5973a654
commit 1444b854e7
2 changed files with 28 additions and 0 deletions

View File

@ -1,3 +1,10 @@
2007-09-23 Martin Nordholts <martinn@svn.gnome.org>
* app/tools/gimprectangleselecttool.c
(gimp_rect_select_tool_draw): Only draw the rectangle when `Show
selection' is `true', with the help of a new function
gimp_rect_select_tool_selection_visible(). Fixes bug #474509.
2007-09-23 Simon Budig <simon@gimp.org> 2007-09-23 Simon Budig <simon@gimp.org>
* plug-ins/common/bumpmap.c: add a few strategically placed * plug-ins/common/bumpmap.c: add a few strategically placed

View File

@ -112,6 +112,7 @@ static void gimp_rect_select_tool_real_select (GimpRectSelectTool *r
gint y, gint y,
gint w, gint w,
gint h); gint h);
static gboolean gimp_rect_select_tool_selection_visible (GimpRectSelectTool*rect_select_tool);
static void gimp_rect_select_tool_update_option_defaults static void gimp_rect_select_tool_update_option_defaults
(GimpRectSelectTool *rect_select_tool, (GimpRectSelectTool *rect_select_tool,
gboolean ignore_pending); gboolean ignore_pending);
@ -244,6 +245,9 @@ gimp_rect_select_tool_draw (GimpDrawTool *draw_tool)
{ {
GimpRectSelectTool *rect_sel = GIMP_RECT_SELECT_TOOL (draw_tool); GimpRectSelectTool *rect_sel = GIMP_RECT_SELECT_TOOL (draw_tool);
if (! gimp_rect_select_tool_selection_visible (rect_sel))
return;
gimp_rectangle_tool_draw (draw_tool); gimp_rectangle_tool_draw (draw_tool);
if (rect_sel->round_corners) if (rect_sel->round_corners)
@ -583,6 +587,23 @@ gimp_rect_select_tool_real_select (GimpRectSelectTool *rect_select,
} }
} }
static gboolean
gimp_rect_select_tool_selection_visible (GimpRectSelectTool *rect_select_tool)
{
GimpTool *tool = GIMP_TOOL (rect_select_tool);
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (tool->display->shell);
/* Don't draw the rectangle if `Show selection' is off. */
if (gimp_tool_control_is_active (tool->control))
{
return rect_select_tool->saved_show_selection;
}
else
{
return gimp_display_shell_get_show_selection (shell);
}
}
/** /**
* gimp_rect_select_tool_update_option_defaults: * gimp_rect_select_tool_update_option_defaults:
* @crop_tool: * @crop_tool: