Commit 9befb859 authored by Ell's avatar Ell
Browse files

pdb: fail layer-remove-mask if applying a mask to a group layer

... which is not supported.
parent e7a2624a
......@@ -1965,9 +1965,13 @@ gimp_layer_apply_mask (GimpLayer *layer,
if (! mask)
return;
/* APPLY can not be done to group layers */
g_return_if_fail (! gimp_viewable_get_children (GIMP_VIEWABLE (layer)) ||
mode == GIMP_MASK_DISCARD);
/* APPLY can only be done to layers with an alpha channel */
if (! gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)))
g_return_if_fail (mode == GIMP_MASK_DISCARD || push_undo == TRUE);
g_return_if_fail (gimp_drawable_has_alpha (GIMP_DRAWABLE (layer)) ||
mode == GIMP_MASK_DISCARD || push_undo == TRUE);
item = GIMP_ITEM (layer);
image = gimp_item_get_image (item);
......
......@@ -770,7 +770,9 @@ layer_remove_mask_invoker (GimpProcedure *procedure,
modify |= GIMP_PDB_ITEM_CONTENT;
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), NULL, modify, error) &&
gimp_layer_get_mask (layer))
gimp_layer_get_mask (layer) &&
(! gimp_viewable_get_children (GIMP_VIEWABLE (layer)) ||
mode == GIMP_MASK_DISCARD))
gimp_layer_apply_mask (layer, mode, TRUE);
else
success = FALSE;
......
......@@ -423,7 +423,9 @@ HELP
modify |= GIMP_PDB_ITEM_CONTENT;
if (gimp_pdb_item_is_attached (GIMP_ITEM (layer), NULL, modify, error) &&
gimp_layer_get_mask (layer))
gimp_layer_get_mask (layer) &&
(! gimp_viewable_get_children (GIMP_VIEWABLE (layer)) ||
mode == GIMP_MASK_DISCARD))
gimp_layer_apply_mask (layer, mode, TRUE);
else
success = FALSE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment