[gimp] app: fix compositing of non-LEGACY layers in "show mask" mode



commit b89d10a83030781c67c89b692ed243320376fa1e
Author: Michael Natterer <mitch gimp org>
Date:   Sun Aug 20 13:20:11 2017 +0200

    app: fix compositing of non-LEGACY layers in "show mask" mode
    
    gimp_layer_update_mode_node(): when showing the mask, set mode to
    NORMAL, and make sure that the composite space is PERCEPTUAL for
    LEGACY layers, and LINEAR (or whatever is chosen in layer attibutes)
    otherwise.

 app/core/gimplayer.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/app/core/gimplayer.c b/app/core/gimplayer.c
index 4a55036..451ce45 100644
--- a/app/core/gimplayer.c
+++ b/app/core/gimplayer.c
@@ -661,10 +661,18 @@ gimp_layer_update_mode_node (GimpLayer *layer)
 
   if (layer->mask && layer->show_mask)
     {
-      visible_mode            = GIMP_LAYER_MODE_NORMAL_LEGACY;
+      visible_mode            = GIMP_LAYER_MODE_NORMAL;
       visible_blend_space     = GIMP_LAYER_COLOR_SPACE_AUTO;
-      visible_composite_space = GIMP_LAYER_COLOR_SPACE_AUTO;
+      visible_composite_space = layer->composite_space;
       visible_composite_mode  = GIMP_LAYER_COMPOSITE_AUTO;
+
+      /* This makes sure that masks of LEGACY-mode layers are
+       * composited in PERCEPTUAL space, and non-LEGACY layers in
+       * LINEAR space, or whatever composite space was chosen in the
+       * layer attributes dialog
+       */
+      if (visible_composite_space == GIMP_LAYER_COLOR_SPACE_AUTO)
+        visible_composite_space = gimp_layer_mode_get_composite_space (layer->mode);
     }
   else
     {


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