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.
This commit is contained in:
David Capello 2014-10-25 13:46:55 -03:00
parent 0e7f424406
commit 2d8303e174

View File

@ -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;