Fix regression clicking same spot w/Rectangular Marquee to deselect

Regression introduced in 26c1a94b833c2e0b56ea6300f8b14e14ada58c62

Reported:
- https://community.aseprite.org/t/12491/1
- https://steamcommunity.com/app/431730/discussions/0/3200371016617015005/
This commit is contained in:
David Capello 2022-01-12 22:18:07 -03:00
parent 8295afbfe2
commit 87e8b45dc1

View File

@ -242,12 +242,18 @@ bool DrawingState::onMouseMove(Editor* editor, MouseMessage* msg)
// Update velocity sensor.
m_velocity.updateWithScreenPoint(msg->position());
// Update pointer with new mouse position
m_lastPointer = tools::Pointer(gfx::Point(m_delayedMouseMove.spritePos()),
m_velocity.velocity(),
button_from_msg(msg),
msg->pointerType(),
msg->pressure());
// Indicate that we've received a real mouse movement event here
// (used in the Rectangular Marquee to deselect when we just do a
// simple click without moving the mouse).
m_mouseMoveReceived = true;
// Use DelayedMouseMove for tools like line, rectangle, etc. (that
// use the only the last mouse position) to filter out rapid mouse
// movement.
@ -347,8 +353,6 @@ void DrawingState::onExposeSpritePixels(const gfx::Region& rgn)
void DrawingState::handleMouseMovement()
{
m_mouseMoveReceived = true;
// Notify mouse movement to the tool
ASSERT(m_toolLoopManager);
m_toolLoopManager->movement(m_lastPointer);