don't change the passed GimpCoords if we didn't snap.

2003-05-05  Michael Natterer  <mitch@gimp.org>

	* app/display/gimpdisplayshell.c (gimp_display_shell_snap_coords):
	don't change the passed GimpCoords if we didn't snap.
This commit is contained in:
Michael Natterer 2003-05-05 11:26:01 +00:00 committed by Michael Natterer
parent d55ef55113
commit 5067bec93b
3 changed files with 47 additions and 30 deletions

View file

@ -1,3 +1,8 @@
2003-05-05 Michael Natterer <mitch@gimp.org>
* app/display/gimpdisplayshell.c (gimp_display_shell_snap_coords):
don't change the passed GimpCoords if we didn't snap.
2003-05-04 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpdialogfactory.c: set GDK_HINT_USER_POS for all

View file

@ -948,29 +948,35 @@ gimp_display_shell_snap_coords (GimpDisplayShell *shell,
shell->snap_to_guides &&
shell->gdisp->gimage->guides)
{
gint tx, ty;
gboolean snapped;
gint tx, ty;
if (snap_width > 0 && snap_height > 0)
{
gimp_image_snap_rectangle (shell->gdisp->gimage,
coords->x + snap_offset_x,
coords->y + snap_offset_y,
coords->x + snap_offset_x + snap_width,
coords->y + snap_offset_y + snap_height,
&tx,
&ty);
snapped = gimp_image_snap_rectangle (shell->gdisp->gimage,
coords->x + snap_offset_x,
coords->y + snap_offset_y,
coords->x + snap_offset_x +
snap_width,
coords->y + snap_offset_y +
snap_height,
&tx,
&ty);
}
else
{
gimp_image_snap_point (shell->gdisp->gimage,
coords->x + snap_offset_x,
coords->y + snap_offset_y,
&tx,
&ty);
snapped = gimp_image_snap_point (shell->gdisp->gimage,
coords->x + snap_offset_x,
coords->y + snap_offset_y,
&tx,
&ty);
}
snapped_coords->x = tx - snap_offset_x;
snapped_coords->y = ty - snap_offset_y;
if (snapped)
{
snapped_coords->x = tx - snap_offset_x;
snapped_coords->y = ty - snap_offset_y;
}
}
}

View file

@ -948,29 +948,35 @@ gimp_display_shell_snap_coords (GimpDisplayShell *shell,
shell->snap_to_guides &&
shell->gdisp->gimage->guides)
{
gint tx, ty;
gboolean snapped;
gint tx, ty;
if (snap_width > 0 && snap_height > 0)
{
gimp_image_snap_rectangle (shell->gdisp->gimage,
coords->x + snap_offset_x,
coords->y + snap_offset_y,
coords->x + snap_offset_x + snap_width,
coords->y + snap_offset_y + snap_height,
&tx,
&ty);
snapped = gimp_image_snap_rectangle (shell->gdisp->gimage,
coords->x + snap_offset_x,
coords->y + snap_offset_y,
coords->x + snap_offset_x +
snap_width,
coords->y + snap_offset_y +
snap_height,
&tx,
&ty);
}
else
{
gimp_image_snap_point (shell->gdisp->gimage,
coords->x + snap_offset_x,
coords->y + snap_offset_y,
&tx,
&ty);
snapped = gimp_image_snap_point (shell->gdisp->gimage,
coords->x + snap_offset_x,
coords->y + snap_offset_y,
&tx,
&ty);
}
snapped_coords->x = tx - snap_offset_x;
snapped_coords->y = ty - snap_offset_y;
if (snapped)
{
snapped_coords->x = tx - snap_offset_x;
snapped_coords->y = ty - snap_offset_y;
}
}
}