app/core/gimpimage-guides.c fixed to accept guide->position ==

2003-03-30  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimage-guides.c
	* tools/pdbgen/pdb/guides.pdb: fixed to accept guide->position ==
	image->width/height. Guides live *between* pixels, so they must be
	able to exist right of/below the image's rightmost/bottom pixel.

	* app/core/gimpimage-crop.c (gimp_image_crop_adjust_guides):
	fixed guide iteration to not crash when the current guide is
	removed from the image (fixes bug #109533).

	* app/pdb/guides_cmds.c: regenerated.
This commit is contained in:
Michael Natterer
2003-03-30 13:09:57 +00:00
committed by Michael Natterer
parent bbb3172db1
commit c736836f9c
5 changed files with 41 additions and 20 deletions

View File

@ -43,7 +43,7 @@ gimp_image_add_hguide (GimpImage *gimage,
GimpGuide *guide;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
g_return_val_if_fail (position >= 0 && position < gimage->height, NULL);
g_return_val_if_fail (position >= 0 && position <= gimage->height, NULL);
guide = g_new0 (GimpGuide, 1);
@ -70,7 +70,7 @@ gimp_image_add_vguide (GimpImage *gimage,
GimpGuide *guide;
g_return_val_if_fail (GIMP_IS_IMAGE (gimage), NULL);
g_return_val_if_fail (position >= 0 && position < gimage->width, NULL);
g_return_val_if_fail (position >= 0 && position <= gimage->width, NULL);
guide = g_new0 (GimpGuide, 1);
@ -120,9 +120,9 @@ gimp_image_add_guide (GimpImage *gimage,
g_return_if_fail (position >= 0);
if (guide->orientation == GIMP_ORIENTATION_HORIZONTAL)
g_return_if_fail (position < gimage->height);
g_return_if_fail (position <= gimage->height);
else
g_return_if_fail (position < gimage->width);
g_return_if_fail (position <= gimage->width);
gimage->guides = g_list_prepend (gimage->guides, guide);
@ -162,9 +162,9 @@ gimp_image_move_guide (GimpImage *gimage,
g_return_if_fail (position >= 0);
if (guide->orientation == GIMP_ORIENTATION_HORIZONTAL)
g_return_if_fail (position < gimage->height);
g_return_if_fail (position <= gimage->height);
else
g_return_if_fail (position < gimage->width);
g_return_if_fail (position <= gimage->width);
if (push_undo)
gimp_image_undo_push_image_guide (gimage, _("Move Guide"), guide);