[gimp] app: when changing layer-mode group, check new mode against context



commit 5f7c03235c713a082e4e7e7f85b20bc057c1bb53
Author: Ell <ell_se yahoo com>
Date:   Mon Oct 23 10:04:23 2017 -0400

    app: when changing layer-mode group, check new mode against context
    
    When changing the layer-mode group in a GimpLayerModeComboBox, check
    the new mode against the combo's context, and fall back to normal if
    it's not applicable.  This is necessary for the color-erase mode,
    which has both a legacy and non-legacy variants.  The former is
    applicable for painting contexts, so we want to map the non-legacy
    mode to it when changing groups, however, it's not applicable for
    layer contexts, so, in this case, we want to map the non-legacy mode
    to normal.

 app/widgets/gimplayermodecombobox.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/app/widgets/gimplayermodecombobox.c b/app/widgets/gimplayermodecombobox.c
index 2a829f7..2697852 100644
--- a/app/widgets/gimplayermodecombobox.c
+++ b/app/widgets/gimplayermodecombobox.c
@@ -442,7 +442,8 @@ gimp_layer_mode_combo_box_update_model (GimpLayerModeComboBox *combo,
 
       if (gimp_layer_mode_get_for_group (combo->priv->layer_mode,
                                          combo->priv->group,
-                                         &new_mode))
+                                         &new_mode) &&
+          (gimp_layer_mode_get_context (new_mode) & combo->priv->context))
         {
           gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo), new_mode);
         }


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