From 442d8c624a682430e7db0fb58b200af2f0c707b6 Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 11 May 2015 09:37:39 -0300 Subject: [PATCH] Fix triggering Editor's onCut() without mask when ColorBar's onCanCut() enables it Asking for onCanCut/Copy/Paste/Clear just before onCut/Copy/Paste/Clear in the same InputChainElement we ensure that the command for that specific element can be used (and we aren't mixing onCans result of one input chain element with the execution of the first input chain element command). --- src/app/ui/input_chain.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/ui/input_chain.cpp b/src/app/ui/input_chain.cpp index 7b5880b3b..394fd33b3 100644 --- a/src/app/ui/input_chain.cpp +++ b/src/app/ui/input_chain.cpp @@ -71,7 +71,7 @@ bool InputChain::canClear(Context* ctx) void InputChain::cut(Context* ctx) { for (auto e : m_elements) { - if (e->onCut(ctx)) + if (e->onCanCut(ctx) && e->onCut(ctx)) break; } } @@ -79,7 +79,7 @@ void InputChain::cut(Context* ctx) void InputChain::copy(Context* ctx) { for (auto e : m_elements) { - if (e->onCopy(ctx)) + if (e->onCanCopy(ctx) && e->onCopy(ctx)) break; } } @@ -87,7 +87,7 @@ void InputChain::copy(Context* ctx) void InputChain::paste(Context* ctx) { for (auto e : m_elements) { - if (e->onPaste(ctx)) + if (e->onCanPaste(ctx) && e->onPaste(ctx)) break; } } @@ -95,7 +95,7 @@ void InputChain::paste(Context* ctx) void InputChain::clear(Context* ctx) { for (auto e : m_elements) { - if (e->onClear(ctx)) + if (e->onCanClear(ctx) && e->onClear(ctx)) break; } }