mirror of
https://github.com/mpv-player/mpv
synced 2025-03-20 02:09:52 +00:00
mac: fix reporting of left wheel and right wheel scrolling
left wheel and right wheel was swapped. this was copied from the old cocoa backend. a delta <0 is a right scroll, >0 is a left scroll. Fixes #12899
This commit is contained in:
parent
bcdc5c40e7
commit
947800ceb8
@ -224,7 +224,7 @@ class View: NSView {
|
||||
cmd = delta > 0 ? SWIFT_WHEEL_UP : SWIFT_WHEEL_DOWN
|
||||
} else {
|
||||
delta = Double(event.deltaX) * 0.1
|
||||
cmd = delta > 0 ? SWIFT_WHEEL_RIGHT : SWIFT_WHEEL_LEFT
|
||||
cmd = delta > 0 ? SWIFT_WHEEL_LEFT : SWIFT_WHEEL_RIGHT
|
||||
}
|
||||
|
||||
mpv?.putAxis(cmd, delta: abs(delta))
|
||||
@ -246,7 +246,7 @@ class View: NSView {
|
||||
if abs(deltaY) >= abs(deltaX) {
|
||||
mpkey = deltaY > 0 ? SWIFT_WHEEL_UP : SWIFT_WHEEL_DOWN
|
||||
} else {
|
||||
mpkey = deltaX > 0 ? SWIFT_WHEEL_RIGHT : SWIFT_WHEEL_LEFT
|
||||
mpkey = deltaX > 0 ? SWIFT_WHEEL_LEFT : SWIFT_WHEEL_RIGHT
|
||||
}
|
||||
|
||||
cocoa_put_key_with_modifiers(mpkey, Int32(modifiers.rawValue))
|
||||
|
Loading…
Reference in New Issue
Block a user