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.
This commit is contained in:
Ell 2017-10-23 10:04:23 -04:00
parent 6f7d95c21c
commit 5f7c03235c
1 changed files with 2 additions and 1 deletions

View File

@ -442,7 +442,8 @@ gimp_layer_mode_combo_box_update_model (GimpLayerModeComboBox *combo,
if (gimp_layer_mode_get_for_group (combo->priv->layer_mode, if (gimp_layer_mode_get_for_group (combo->priv->layer_mode,
combo->priv->group, 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); gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (combo), new_mode);
} }