Unbreak rectangle select tool undo handling a bit:

2007-02-08  Michael Natterer  <mitch@gimp.org>

	Unbreak rectangle select tool undo handling a bit:

	* app/tools/gimprectangleselecttool.c (gimp_rect_select_tool_select):
	add boolean return value indicating if something was actually selected.

	(gimp_rect_select_tool_rectangle_changed): peek the newly pushed
	undo only if we selected something.


svn path=/trunk/; revision=21866
This commit is contained in:
Michael Natterer
2007-02-08 09:54:09 +00:00
committed by Michael Natterer
parent 50a39fb96e
commit f7bfea19d9
2 changed files with 22 additions and 7 deletions

View File

@ -1,3 +1,13 @@
2007-02-08 Michael Natterer <mitch@gimp.org>
Unbreak rectangle select tool undo handling a bit:
* app/tools/gimprectangleselecttool.c (gimp_rect_select_tool_select):
add boolean return value indicating if something was actually selected.
(gimp_rect_select_tool_rectangle_changed): peek the newly pushed
undo only if we selected something.
2007-02-08 Sven Neumann <sven@gimp.org>
* libgimpwidgets/gimpratioentry.[ch]: added history and completion.

View File

@ -91,7 +91,7 @@ static void gimp_rect_select_tool_cursor_update (GimpTool *to
GdkModifierType state,
GimpDisplay *display);
static void gimp_rect_select_tool_draw (GimpDrawTool *draw_tool);
static void gimp_rect_select_tool_select (GimpRectangleTool *rect_tool,
static gboolean gimp_rect_select_tool_select (GimpRectangleTool *rect_tool,
gint x,
gint y,
gint w,
@ -483,7 +483,7 @@ gimp_rect_select_tool_cursor_update (GimpTool *tool,
}
static void
static gboolean
gimp_rect_select_tool_select (GimpRectangleTool *rectangle,
gint x,
gint y,
@ -517,6 +517,8 @@ gimp_rect_select_tool_select (GimpRectangleTool *rectangle,
GIMP_RECT_SELECT_TOOL_GET_CLASS (rect_select)->select (rect_select,
operation,
x, y, w, h);
return rectangle_exists;
}
static void
@ -743,11 +745,14 @@ gimp_rect_select_tool_rectangle_changed (GimpRectangleTool *rectangle)
"y2", &y2,
NULL);
gimp_rect_select_tool_select (rectangle, x1, y1, x2 - x1, y2 - y1);
/* save the undo that we got when executing */
rect_select->undo = gimp_undo_stack_peek (image->undo_stack);
rect_select->redo = NULL;
if (gimp_rect_select_tool_select (rectangle, x1, y1, x2 - x1, y2 - y1))
{
/* save the undo that we got when executing, but only if
* we actually selected something
*/
rect_select->undo = gimp_undo_stack_peek (image->undo_stack);
rect_select->redo = NULL;
}
if (! rect_select->use_saved_op)
{