mirror of https://github.com/GNOME/gimp.git
Skip group layers when transforming the entire image
Group layers update themselves when their children change, so simply skip them when cropping, flipping, resizing, rotating or scaling the image.
This commit is contained in:
parent
cb1e3afba4
commit
86a76d6237
|
@ -178,6 +178,10 @@ gimp_image_crop (GimpImage *image,
|
||||||
{
|
{
|
||||||
item = (GimpItem *) list->data;
|
item = (GimpItem *) list->data;
|
||||||
|
|
||||||
|
/* group layers are updated automatically */
|
||||||
|
if (gimp_viewable_get_children (GIMP_VIEWABLE (item)))
|
||||||
|
continue;
|
||||||
|
|
||||||
gimp_item_translate (item, -x1, -y1, TRUE);
|
gimp_item_translate (item, -x1, -y1, TRUE);
|
||||||
|
|
||||||
if (crop_layers)
|
if (crop_layers)
|
||||||
|
|
|
@ -116,6 +116,10 @@ gimp_image_flip (GimpImage *image,
|
||||||
{
|
{
|
||||||
GimpItem *item = list->data;
|
GimpItem *item = list->data;
|
||||||
|
|
||||||
|
/* group layers are updated automatically */
|
||||||
|
if (gimp_viewable_get_children (GIMP_VIEWABLE (item)))
|
||||||
|
continue;
|
||||||
|
|
||||||
gimp_item_flip (item, context, flip_type, axis, FALSE);
|
gimp_item_flip (item, context, flip_type, axis, FALSE);
|
||||||
|
|
||||||
if (progress)
|
if (progress)
|
||||||
|
|
|
@ -154,6 +154,10 @@ gimp_image_resize_with_layers (GimpImage *image,
|
||||||
gint old_offset_x;
|
gint old_offset_x;
|
||||||
gint old_offset_y;
|
gint old_offset_y;
|
||||||
|
|
||||||
|
/* group layers are updated automatically */
|
||||||
|
if (gimp_viewable_get_children (GIMP_VIEWABLE (item)))
|
||||||
|
continue;
|
||||||
|
|
||||||
gimp_item_get_offset (item, &old_offset_x, &old_offset_y);
|
gimp_item_get_offset (item, &old_offset_x, &old_offset_y);
|
||||||
|
|
||||||
gimp_item_translate (item, offset_x, offset_y, TRUE);
|
gimp_item_translate (item, offset_x, offset_y, TRUE);
|
||||||
|
|
|
@ -176,6 +176,10 @@ gimp_image_rotate (GimpImage *image,
|
||||||
gint off_x;
|
gint off_x;
|
||||||
gint off_y;
|
gint off_y;
|
||||||
|
|
||||||
|
/* group layers are updated automatically */
|
||||||
|
if (gimp_viewable_get_children (GIMP_VIEWABLE (item)))
|
||||||
|
continue;
|
||||||
|
|
||||||
gimp_item_get_offset (item, &off_x, &off_y);
|
gimp_item_get_offset (item, &off_x, &off_y);
|
||||||
|
|
||||||
gimp_item_rotate (item, context, rotate_type, center_x, center_y, FALSE);
|
gimp_item_rotate (item, context, rotate_type, center_x, center_y, FALSE);
|
||||||
|
|
|
@ -150,6 +150,10 @@ gimp_image_scale (GimpImage *image,
|
||||||
gimp_sub_progress_set_step (GIMP_SUB_PROGRESS (sub_progress),
|
gimp_sub_progress_set_step (GIMP_SUB_PROGRESS (sub_progress),
|
||||||
progress_current++, progress_steps);
|
progress_current++, progress_steps);
|
||||||
|
|
||||||
|
/* group layers are updated automatically */
|
||||||
|
if (gimp_viewable_get_children (GIMP_VIEWABLE (item)))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (! gimp_item_scale_by_factors (item,
|
if (! gimp_item_scale_by_factors (item,
|
||||||
img_scale_w, img_scale_h,
|
img_scale_w, img_scale_h,
|
||||||
interpolation_type, sub_progress))
|
interpolation_type, sub_progress))
|
||||||
|
@ -327,6 +331,10 @@ gimp_image_scale_check (const GimpImage *image,
|
||||||
{
|
{
|
||||||
GimpItem *item = list->data;
|
GimpItem *item = list->data;
|
||||||
|
|
||||||
|
/* group layers are updated automatically */
|
||||||
|
if (gimp_viewable_get_children (GIMP_VIEWABLE (item)))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (! gimp_item_check_scaling (item, new_width, new_height))
|
if (! gimp_item_check_scaling (item, new_width, new_height))
|
||||||
{
|
{
|
||||||
g_list_free (all_layers);
|
g_list_free (all_layers);
|
||||||
|
|
Loading…
Reference in New Issue