mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-19 06:40:42 +00:00
Support smooth scroll in timeline
This commit is contained in:
parent
abc586a6d4
commit
489e7da6ec
@ -872,23 +872,23 @@ bool Timeline::onProcessMessage(Message* msg)
|
|||||||
|
|
||||||
case kMouseWheelMessage:
|
case kMouseWheelMessage:
|
||||||
if (m_document) {
|
if (m_document) {
|
||||||
int dz = static_cast<MouseMessage*>(msg)->wheelDelta().y;
|
gfx::Point delta = static_cast<MouseMessage*>(msg)->wheelDelta();
|
||||||
int dx = 0;
|
if (!static_cast<MouseMessage*>(msg)->preciseWheel()) {
|
||||||
int dy = 0;
|
delta.x *= FRMSIZE;
|
||||||
|
delta.y *= LAYSIZE;
|
||||||
|
|
||||||
dx += static_cast<MouseMessage*>(msg)->wheelDelta().x;
|
if (msg->shiftPressed()) {
|
||||||
|
// On macOS shift already changes the wheel axis
|
||||||
|
if (std::fabs(delta.y) > delta.x)
|
||||||
|
std::swap(delta.x, delta.y);
|
||||||
|
}
|
||||||
|
|
||||||
if (msg->ctrlPressed())
|
if (msg->altPressed()) {
|
||||||
dx = dz * FRMSIZE;
|
delta.x *= 3;
|
||||||
else
|
delta.y *= 3;
|
||||||
dy = dz * LAYSIZE;
|
}
|
||||||
|
|
||||||
if (msg->shiftPressed()) {
|
|
||||||
dx *= 3;
|
|
||||||
dy *= 3;
|
|
||||||
}
|
}
|
||||||
|
setViewScroll(viewScroll() + delta);
|
||||||
setViewScroll(viewScroll() + gfx::Point(dx, dy));
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user