Fix ScrollingState crash (fix #2115)

Before this fix Aseprite was crashing when we kept holding the mouse
middle button down, then pasting, and finally pressing undo.
This commit is contained in:
Gaspar Capello 2019-07-31 15:16:08 -03:00 committed by David Capello
parent c409494639
commit 2d3be681e0

View File

@ -25,6 +25,14 @@ namespace app {
virtual bool onKeyUp(Editor* editor, ui::KeyMessage* msg) override;
virtual bool onUpdateStatusBar(Editor* editor) override;
virtual LeaveAction onLeaveState(Editor* editor, EditorState* newState) override {
// Just discard this state if we want to enter to another state
// e.g. if we want to enter to MovingPixelsState when the user
// press Ctrl+V when we are scrolling, we have to just discard
// this state (stop the scrolling action).
return DiscardState;
}
private:
gfx::Point m_oldPos;
};