mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-11 18:41:05 +00:00
Fix delta values with non-precise mouse wheels on OS X
This commit is contained in:
parent
46619e9ff2
commit
2d2fb0038a
@ -406,9 +406,19 @@ bool is_key_pressed(KeyScancode scancode)
|
||||
ev.setPreciseWheel(true);
|
||||
}
|
||||
else {
|
||||
// Ignore the acceleration factor, just use the wheel sign.
|
||||
gfx::Point pt(0, 0);
|
||||
if (event.scrollingDeltaX >= 0.1)
|
||||
pt.x = -1;
|
||||
else if (event.scrollingDeltaX <= -0.1)
|
||||
pt.x = 1;
|
||||
if (event.scrollingDeltaY >= 0.1)
|
||||
pt.y = -1;
|
||||
else if (event.scrollingDeltaY <= -0.1)
|
||||
pt.y = 1;
|
||||
|
||||
ev.setPointerType(she::PointerType::Mouse);
|
||||
ev.setWheelDelta(gfx::Point(-event.scrollingDeltaX,
|
||||
-event.scrollingDeltaY));
|
||||
ev.setWheelDelta(pt);
|
||||
}
|
||||
|
||||
queue_event(ev);
|
||||
|
Loading…
x
Reference in New Issue
Block a user