A click might have slightly adjusted the points, so revert before doing

2008-05-25  Martin Nordholts  <martinn@svn.gnome.org>

	* app/tools/gimpfreeselecttool.c
	(gimp_free_select_tool_handle_click): A click might have slightly
	adjusted the points, so revert before doing the selection.
	(gimp_free_select_tool_revert_to_saved_state): Move definition up
	a bit.

svn path=/trunk/; revision=25792
This commit is contained in:
Martin Nordholts 2008-05-25 11:48:37 +00:00 committed by Martin Nordholts
parent 820379250b
commit 866cc37543
2 changed files with 63 additions and 49 deletions

View File

@ -1,3 +1,11 @@
2008-05-25 Martin Nordholts <martinn@svn.gnome.org>
* app/tools/gimpfreeselecttool.c
(gimp_free_select_tool_handle_click): A click might have slightly
adjusted the points, so revert before doing the selection.
(gimp_free_select_tool_revert_to_saved_state): Move definition up
a bit.
2008-05-25 Martin Nordholts <martinn@svn.gnome.org>
Make moving selection mask/pixels within the selection work for

View File

@ -705,55 +705,6 @@ gimp_free_select_tool_commit (GimpFreeSelectTool *fst,
gimp_image_flush (display->image);
}
static void
gimp_free_select_tool_handle_click (GimpFreeSelectTool *fst,
GimpCoords *coords,
GimpDisplay *display)
{
/* If there is a floating selection, anchor it */
if (gimp_image_floating_sel (display->image))
{
floating_sel_anchor (gimp_image_floating_sel (display->image));
gimp_free_select_tool_halt (fst);
}
else
{
/* First finish of the line segment if no point was grabbed */
if (! gimp_free_select_tool_is_point_grabbed (fst))
{
gimp_free_select_tool_finish_line_segment (fst);
}
/* After the segments are up to date, see if it's commiting time */
if (gimp_free_select_tool_should_close (fst,
display,
coords))
{
gimp_free_select_tool_commit (fst, display);
}
}
}
static void
gimp_free_select_tool_handle_normal_release (GimpFreeSelectTool *fst,
GimpCoords *coords,
GimpDisplay *display)
{
/* First finish of the free segment if no point was grabbed */
if (! gimp_free_select_tool_is_point_grabbed (fst))
{
gimp_free_select_tool_finish_free_segment (fst);
}
/* After the segments are up to date, see if it's commiting time */
if (gimp_free_select_tool_should_close (fst,
display,
coords))
{
gimp_free_select_tool_commit (fst, display);
}
}
static void
gimp_free_select_tool_revert_to_saved_state (GimpFreeSelectTool *fst)
{
@ -788,6 +739,61 @@ gimp_free_select_tool_revert_to_saved_state (GimpFreeSelectTool *fst)
}
}
static void
gimp_free_select_tool_handle_click (GimpFreeSelectTool *fst,
GimpCoords *coords,
GimpDisplay *display)
{
/* If there is a floating selection, anchor it */
if (gimp_image_floating_sel (display->image))
{
floating_sel_anchor (gimp_image_floating_sel (display->image));
gimp_free_select_tool_halt (fst);
}
else
{
/* First finish of the line segment if no point was grabbed */
if (! gimp_free_select_tool_is_point_grabbed (fst))
{
gimp_free_select_tool_finish_line_segment (fst);
}
/* After the segments are up to date, see if it's commiting time */
if (gimp_free_select_tool_should_close (fst,
display,
coords))
{
/* We can get a click notification even though the end point
* has been moved a few pixels. Since a move will change the
* free selection, revert it before doing the commit.
*/
gimp_free_select_tool_revert_to_saved_state (fst);
gimp_free_select_tool_commit (fst, display);
}
}
}
static void
gimp_free_select_tool_handle_normal_release (GimpFreeSelectTool *fst,
GimpCoords *coords,
GimpDisplay *display)
{
/* First finish of the free segment if no point was grabbed */
if (! gimp_free_select_tool_is_point_grabbed (fst))
{
gimp_free_select_tool_finish_free_segment (fst);
}
/* After the segments are up to date, see if it's commiting time */
if (gimp_free_select_tool_should_close (fst,
display,
coords))
{
gimp_free_select_tool_commit (fst, display);
}
}
static void
gimp_free_select_tool_handle_cancel (GimpFreeSelectTool *fst)
{