Call eyedropper with right-click only when we have the mouse capture (fix #706)

This commit is contained in:
David Capello 2015-08-19 18:05:03 -03:00
parent 2b4c531e8e
commit 1bee62ce8a

View File

@ -218,6 +218,7 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg)
// Call the eyedropper command
if (clickedInk->isEyedropper()) {
editor->captureMouse();
callEyedropper(editor);
return true;
}
@ -290,8 +291,10 @@ bool StandbyState::onMouseMove(Editor* editor, MouseMessage* msg)
// We control eyedropper tool from here. TODO move this to another place
if (msg->left() || msg->right()) {
tools::Ink* clickedInk = editor->getCurrentEditorInk();
if (clickedInk->isEyedropper())
if (clickedInk->isEyedropper() &&
editor->hasCapture()) {
callEyedropper(editor);
}
}
editor->showBrushPreview(msg->position());