[gimp] gimp_layer_duplicate(): don't set lock-alpha if it can't be set



commit a8b0e3c943184e56c849bc5fdad9cad0de56b260
Author: Michael Natterer <mitch gimp org>
Date:   Tue Sep 8 22:09:03 2009 +0200

    gimp_layer_duplicate(): don't set lock-alpha if it can't be set

 app/core/gimplayer.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c
index dff0e3b..bc322f7 100644
--- a/app/core/gimplayer.c
+++ b/app/core/gimplayer.c
@@ -507,12 +507,12 @@ gimp_layer_duplicate (GimpItem *item,
       GimpLayer *layer     = GIMP_LAYER (item);
       GimpLayer *new_layer = GIMP_LAYER (new_item);
 
-      gimp_layer_set_mode       (new_layer,
-                                 gimp_layer_get_mode (layer), FALSE);
-      gimp_layer_set_opacity    (new_layer,
-                                 gimp_layer_get_opacity (layer), FALSE);
-      gimp_layer_set_lock_alpha (new_layer,
-                                 gimp_layer_get_lock_alpha (layer), FALSE);
+      gimp_layer_set_mode    (new_layer, gimp_layer_get_mode (layer),    FALSE);
+      gimp_layer_set_opacity (new_layer, gimp_layer_get_opacity (layer), FALSE);
+
+      if (gimp_layer_can_lock_alpha (new_layer))
+        gimp_layer_set_lock_alpha (new_layer,
+                                   gimp_layer_get_lock_alpha (layer), FALSE);
 
       /*  duplicate the layer mask if necessary  */
       if (layer->mask)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]