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 regression where frames would change in Edit Selection

Iris Hormoviticfb5182937a5
diff --git a/libs/ui/input/kis_change_frame_action.cpp b/libs/ui/input/kis_change_frame_action.cpp
index 74255ad96a..1f1be3dfb3 100644
--- a/libs/ui/input/kis_change_frame_action.cpp
+++ b/libs/ui/input/kis_change_frame_action.cpp
@@ -48,7 +48,23 @@ bool KisChangeFrameAction::isAvailable() const
KisImageWSP image = canvas->image();
if (!bool(image)) return false;
- return image->animationInterface()->hasAnimation();
+ // Only works when this image has animation
+ if (!image->animationInterface()->hasAnimation()) {
+ return false;
+ }
+
+ // Prevents when in Edit Selection
+ KisNodeSP activeNode = canvas->viewManager()->activeNode();
+ if (activeNode && activeNode->inherits("KisSelectionMask")) {
+ return false;
+ }
+
+ // Prevents when a shape is selected
+ if (canvas->toolProxy() && canvas->toolProxy()->hasSelection()) {
+ return false;
+ }
+
+ return true;
}
void KisChangeFrameAction::begin(int shortcut, QEvent *event)