app: gimp_image_rotate(): fix rotation of sample points

and also notify the image of guide and sample point movements after
rotation. This was probably broken since the introduction of canvas
items.
This commit is contained in:
Michael Natterer 2014-05-24 22:41:21 +02:00
parent df8964a1ce
commit 21ea6216f7
1 changed files with 22 additions and 6 deletions

View File

@ -211,6 +211,22 @@ gimp_image_rotate (GimpImage *image,
gimp_image_set_resolution (image, yres, xres);
}
/* Notify guide movements */
for (list = gimp_image_get_guides (image);
list;
list = g_list_next (list))
{
gimp_image_guide_moved (image, list->data);
}
/* Notify sample point movements */
for (list = gimp_image_get_sample_points (image);
list;
list = g_list_next (list))
{
gimp_image_sample_point_moved (image, list->data);
}
gimp_image_undo_group_end (image);
if (size_changed)
@ -365,18 +381,18 @@ gimp_image_rotate_sample_points (GimpImage *image,
switch (rotate_type)
{
case GIMP_ROTATE_90:
sample_point->x = old_y;
sample_point->y = gimp_image_get_height (image) - old_x;
sample_point->x = gimp_image_get_height (image) - old_y;
sample_point->y = old_x;
break;
case GIMP_ROTATE_180:
sample_point->x = gimp_image_get_height (image) - old_x;
sample_point->y = gimp_image_get_width (image) - old_y;
sample_point->x = gimp_image_get_width (image) - old_x;
sample_point->y = gimp_image_get_height (image) - old_y;
break;
case GIMP_ROTATE_270:
sample_point->x = gimp_image_get_width (image) - old_y;
sample_point->y = old_x;
sample_point->x = old_y;
sample_point->y = gimp_image_get_width (image) - old_x;
break;
}
}