From 2d8303e174b9478fe0a2217e8ed38fac71cac557 Mon Sep 17 00:00:00 2001 From: David Capello Date: Sat, 25 Oct 2014 13:46:55 -0300 Subject: [PATCH] Arrow keys move the selection only when the current tool/ink is about selection This fix a problem where arrow keys cleared the selection content when they were used with a non-selection tool. --- src/app/modules/gui.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/app/modules/gui.cpp b/src/app/modules/gui.cpp index b372e8ae5..1f94ac9aa 100644 --- a/src/app/modules/gui.cpp +++ b/src/app/modules/gui.cpp @@ -157,10 +157,13 @@ static void save_gui_config(); static KeyContext get_current_keycontext() { - DocumentLocation location = UIContext::instance()->activeLocation(); - Document* document = location.document(); + app::Context* ctx = UIContext::instance(); + DocumentLocation location = ctx->activeLocation(); + Document* doc = location.document(); - if (document && document->isMaskVisible()) + if (doc && + doc->isMaskVisible() && + ctx->settings()->getCurrentTool()->getInk(0)->isSelection()) return KeyContext::Selection; else return KeyContext::Normal;