Commit e8658ec7 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer
Browse files

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.
parent e17b69fe
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> 2005-08-07 Sven Neumann <sven@gimp.org>
* app/base/siox.c: made variables more local to make the code * app/base/siox.c: made variables more local to make the code
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "gimpimage.h" #include "gimpimage.h"
#include "gimpimage-guides.h" #include "gimpimage-guides.h"
#include "gimpimage-resize.h" #include "gimpimage-resize.h"
#include "gimpimage-sample-points.h"
#include "gimpimage-undo.h" #include "gimpimage-undo.h"
#include "gimpimage-undo-push.h" #include "gimpimage-undo-push.h"
#include "gimplayer.h" #include "gimplayer.h"
...@@ -213,6 +214,32 @@ gimp_image_resize_with_layers (GimpImage *gimage, ...@@ -213,6 +214,32 @@ gimp_image_resize_with_layers (GimpImage *gimage,
gimp_image_move_guide (gimage, guide, new_position, TRUE); 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_image_undo_group_end (gimage);
gimp_viewable_size_changed (GIMP_VIEWABLE (gimage)); gimp_viewable_size_changed (GIMP_VIEWABLE (gimage));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment