Bug 735904 - Zealous crop of an image with a selection duplicates image data

Clear the selection before calling gimp_drawable_merge_shadow(), because
the selection affects the merge, which is unwanted here.
This commit is contained in:
Michael Natterer 2014-09-10 00:09:28 +02:00
parent 8a2a9775b9
commit aa0912fcd6
1 changed files with 11 additions and 2 deletions

View File

@ -180,6 +180,7 @@ do_zcrop (GimpDrawable *drawable,
gint8 *killcols;
gint32 livingrows, livingcols, destrow, destcol;
gint total_area, area;
gint32 selection_copy;
gboolean has_alpha;
width = drawable->width;
@ -294,13 +295,21 @@ do_zcrop (GimpDrawable *drawable,
g_free (killrows);
g_free (killcols);
gimp_progress_update (1.00);
gimp_drawable_flush (drawable);
gimp_image_undo_group_start (image_id);
gimp_drawable_flush (drawable);
selection_copy = gimp_selection_save (image_id);
gimp_selection_none (image_id);
gimp_drawable_merge_shadow (drawable->drawable_id, TRUE);
gimp_image_select_item (image_id, GIMP_CHANNEL_OP_REPLACE, selection_copy);
gimp_image_remove_channel (image_id, selection_copy);
gimp_image_crop (image_id, livingcols, livingrows, 0, 0);
gimp_image_undo_group_end (image_id);
gimp_progress_update (1.00);
}