mirror of https://github.com/GNOME/gimp.git
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:
parent
df8964a1ce
commit
21ea6216f7
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue