take care of sample points. Addresses bug #137776.

2005-08-07  Michael Natterer  <mitch@gimp.org>

	* app/core/gimpimage-resize.c (gimp_image_resize_with_layers):
	take care of sample points. Addresses bug #137776.
This commit is contained in:
Michael Natterer 2005-08-07 21:05:09 +00:00 committed by Michael Natterer
parent e17b69fe43
commit e8658ec7f9
2 changed files with 32 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2005-08-07 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage-resize.c (gimp_image_resize_with_layers):
take care of sample points. Addresses bug #137776.
2005-08-07 Sven Neumann <sven@gimp.org>
* app/base/siox.c: made variables more local to make the code

View File

@ -27,6 +27,7 @@
#include "gimpimage.h"
#include "gimpimage-guides.h"
#include "gimpimage-resize.h"
#include "gimpimage-sample-points.h"
#include "gimpimage-undo.h"
#include "gimpimage-undo-push.h"
#include "gimplayer.h"
@ -213,6 +214,32 @@ gimp_image_resize_with_layers (GimpImage *gimage,
gimp_image_move_guide (gimage, guide, new_position, TRUE);
}
/* Reposition or remove sample points */
list = gimage->sample_points;
while (list)
{
GimpSamplePoint *sample_point = list->data;
gboolean remove_sample_point = FALSE;
gint new_x = sample_point->x;
gint new_y = sample_point->y;
list = g_list_next (list);
new_y += offset_y;
if ((sample_point->y < 0) || (sample_point->y > new_height))
remove_sample_point = TRUE;
new_x += offset_x;
if ((sample_point->x < 0) || (sample_point->x > new_width))
remove_sample_point = TRUE;
if (remove_sample_point)
gimp_image_remove_sample_point (gimage, sample_point, TRUE);
else if (new_x != sample_point->x || new_y != sample_point->y)
gimp_image_move_sample_point (gimage, sample_point,
new_x, new_y, TRUE);
}
gimp_image_undo_group_end (gimage);
gimp_viewable_size_changed (GIMP_VIEWABLE (gimage));