Commit efb062b8 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Allow masks on group layers

When copying a mask to the clipboard, the masks are added to a
default, empty image. That means, to a group layer without a
parent. This is perfectly fine, but we have never allowed it
before. The only important check is whether the root layer already
has a selection mask, the global selection.

BUG:397796
parent 7c2fce1d
......@@ -121,10 +121,17 @@ bool KisGroupLayer::checkNodeRecursively(KisNodeSP node) const
bool KisGroupLayer::allowAsChild(KisNodeSP node) const
{
return checkNodeRecursively(node) &&
(parent() ||
(node->inherits("KisSelectionMask") && !selectionMask()) ||
!node->inherits("KisMask"));
if (!parent()) { // We are the root layer, so we need to check
// whether the node that's going to be added is
// a selection mask; that is only allowed if
// there isn't a global selection. See
// BUG:294905
if (node->inherits("KisSelectionMask") && !selectionMask()) {
return false;
}
}
return checkNodeRecursively(node);
}
const KoColorSpace * KisGroupLayer::colorSpace() const
......
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