Add auto-scroll on moving cel & moving selection states

This commit is contained in:
David Capello 2017-04-07 08:37:35 -03:00
parent b8c64b31c1
commit 4250809b1e
2 changed files with 4 additions and 2 deletions

View File

@ -200,7 +200,8 @@ bool MovingCelState::onMouseUp(Editor* editor, MouseMessage* msg)
bool MovingCelState::onMouseMove(Editor* editor, MouseMessage* msg)
{
gfx::PointF newCursorPos = editor->screenToEditorF(msg->position());
const gfx::Point mousePos = editor->autoScroll(msg, AutoScroll::MouseDir);
const gfx::PointF newCursorPos = editor->screenToEditorF(mousePos);
switch (m_handle) {

View File

@ -80,7 +80,8 @@ bool MovingSelectionState::onMouseUp(Editor* editor, MouseMessage* msg)
bool MovingSelectionState::onMouseMove(Editor* editor, MouseMessage* msg)
{
const gfx::Point newCursorPos = editor->screenToEditor(msg->position());
const gfx::Point mousePos = editor->autoScroll(msg, AutoScroll::MouseDir);
const gfx::Point newCursorPos = editor->screenToEditor(mousePos);
m_delta = newCursorPos - m_cursorStart;
const gfx::Point newMaskOrigin = m_selOrigin + m_delta;
const gfx::Point oldMaskOrigin = editor->document()->mask()->bounds().origin();