Stop animation with right-click

This commit is contained in:
David Capello 2015-04-30 19:54:30 -03:00
parent b8a319ed6b
commit 82bcc090c0

View File

@ -18,6 +18,7 @@
#include "app/ui/editor/editor.h"
#include "app/ui/editor/scrolling_state.h"
#include "app/ui_context.h"
#include "ui/message.h"
#include "ui/system.h"
namespace app {
@ -65,6 +66,12 @@ bool PlayState::onMouseDown(Editor* editor, MouseMessage* msg)
UIContext* context = UIContext::instance();
context->setActiveView(editor->getDocumentView());
// A click with right-button stops the animation
if (msg->buttons() == kButtonRight) {
editor->stop();
return true;
}
// Start scroll loop
EditorStatePtr newState(new ScrollingState());
editor->setState(newState);