[gimp/gimp-2-6] Bug 585488 – Perspective transformation on a layer with a mask causes crash
- From: Michael Natterer <mitch src gnome org>
- To: svn-commits-list gnome org
- Subject: [gimp/gimp-2-6] Bug 585488 – Perspective transformation on a layer with a mask causes crash
- Date: Wed, 17 Jun 2009 15:19:38 -0400 (EDT)
commit a55a33cab10b64e8bd7b379673656ea208bdbd57
Author: Michael Natterer <mitch gimp org>
Date: Wed Jun 17 21:14:32 2009 +0200
Bug 585488 â?? Perspective transformation on a layer with a mask causes crash
(gimp_drawable_transform_affine)
(gimp_drawable_transform_flip)
(gimp_drawable_transform_rotate): also transform the layer mask if we
are transforming a layer and there is no selection (which causes the
entire layer to be transformed).
app/core/gimpdrawable-transform.c | 43 +++++++++++++++++++++++++++++++++++++
1 files changed, 43 insertions(+), 0 deletions(-)
---
diff --git a/app/core/gimpdrawable-transform.c b/app/core/gimpdrawable-transform.c
index 978c2c0..3d66d51 100644
--- a/app/core/gimpdrawable-transform.c
+++ b/app/core/gimpdrawable-transform.c
@@ -577,6 +577,22 @@ gimp_drawable_transform_affine (GimpDrawable *drawable,
if (GIMP_IS_CHANNEL (drawable) && tile_manager_bpp (orig_tiles) == 1)
clip_result = GIMP_TRANSFORM_RESIZE_CLIP;
+ /* also transform the mask if we are transforming an entire layer */
+ if (GIMP_IS_LAYER (drawable) &&
+ gimp_layer_get_mask (GIMP_LAYER (drawable)) &&
+ gimp_channel_is_empty (gimp_image_get_mask (image)))
+ {
+ GimpLayerMask *mask = gimp_layer_get_mask (GIMP_LAYER (drawable));
+
+ gimp_item_transform (GIMP_ITEM (mask), context,
+ matrix,
+ direction,
+ interpolation_type,
+ recursion_level,
+ clip_result,
+ progress);
+ }
+
/* transform the buffer */
new_tiles = gimp_drawable_transform_tiles_affine (drawable, context,
orig_tiles,
@@ -664,6 +680,19 @@ gimp_drawable_transform_flip (GimpDrawable *drawable,
if (GIMP_IS_CHANNEL (drawable) && tile_manager_bpp (orig_tiles) == 1)
clip_result = TRUE;
+ /* also transform the mask if we are transforming an entire layer */
+ if (GIMP_IS_LAYER (drawable) &&
+ gimp_layer_get_mask (GIMP_LAYER (drawable)) &&
+ gimp_channel_is_empty (gimp_image_get_mask (image)))
+ {
+ GimpLayerMask *mask = gimp_layer_get_mask (GIMP_LAYER (drawable));
+
+ gimp_item_flip (GIMP_ITEM (mask), context,
+ flip_type,
+ axis,
+ clip_result);
+ }
+
/* transform the buffer */
if (orig_tiles)
{
@@ -740,6 +769,20 @@ gimp_drawable_transform_rotate (GimpDrawable *drawable,
if (GIMP_IS_CHANNEL (drawable) && tile_manager_bpp (orig_tiles) == 1)
clip_result = TRUE;
+ /* also transform the mask if we are transforming an entire layer */
+ if (GIMP_IS_LAYER (drawable) &&
+ gimp_layer_get_mask (GIMP_LAYER (drawable)) &&
+ gimp_channel_is_empty (gimp_image_get_mask (image)))
+ {
+ GimpLayerMask *mask = gimp_layer_get_mask (GIMP_LAYER (drawable));
+
+ gimp_item_rotate (GIMP_ITEM (mask), context,
+ rotate_type,
+ center_x,
+ center_y,
+ clip_result);
+ }
+
/* transform the buffer */
new_tiles = gimp_drawable_transform_tiles_rotate (drawable, context,
orig_tiles,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]