Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Fix a safe assert when merging invisible and locked layer

Dmitry Kazakovec7a3aa98d53
diff --git a/libs/image/kis_layer_utils.cpp b/libs/image/kis_layer_utils.cpp
index cdb7ffbe73..f5f3fcc829 100644
--- a/libs/image/kis_layer_utils.cpp
+++ b/libs/image/kis_layer_utils.cpp
@@ -1728,8 +1728,13 @@ namespace Private {
int putAfterIndex = -1;
Q_FOREACH(KisNodeSP node, nodes) {
- if (node->visible() || node->userLocked()) {
+ if (node->visible()) {
visibleNodes << node;
+ } else if (node->userLocked()) {
+ /**
+ * When a layer is invisible and user-locked we should just skip
+ * it and do neither merge nor remove it.
+ */
} else {
*invisibleNodes << node;