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 an assert when changing pass-through mode of a group layer with a color overlay

Dmitry Kazakov0e0cfda2063e
diff --git a/libs/image/commands/kis_node_property_list_command.cpp b/libs/image/commands/kis_node_property_list_command.cpp
index 5d2319b3e3..9abe9548e3 100644
--- a/libs/image/commands/kis_node_property_list_command.cpp
+++ b/libs/image/commands/kis_node_property_list_command.cpp
@@ -110,7 +110,13 @@ bool KisNodePropertyListCommand::mergeWith(const KUndo2Command *command)
changedProperties(m_oldPropertyList, m_newPropertyList) ==
changedProperties(other->m_oldPropertyList, other->m_newPropertyList))) {
- KIS_SAFE_ASSERT_RECOVER_NOOP(m_newPropertyList == other->m_oldPropertyList);
+ const QSet<QString> changedInTheMeantime =
+ changedProperties(m_newPropertyList, other->m_oldPropertyList);
+
+ KIS_SAFE_ASSERT_RECOVER_NOOP(changedInTheMeantime.isEmpty() ||
+ (changedInTheMeantime.size() == 1 &&
+ *changedInTheMeantime.begin() == KisLayerPropertiesIcons::colorOverlay.id()));
+
m_newPropertyList = other->m_newPropertyList;
return true;
}