From a36a60375e4321d3f1e0ddeb5c9fcc3bc8f46692 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Fri, 21 Sep 2007 21:00:41 +0000 Subject: [PATCH] Reverse audio display scrolling on Mac to have natural scrolling directions for four-way scrolling devices. (Unfortunately those also exist for Windows and other systems, can't support those properly ATM.) Originally committed to SVN as r1569. --- aegisub/audio_display.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/aegisub/audio_display.cpp b/aegisub/audio_display.cpp index 7ed6b1813..5e4969c99 100644 --- a/aegisub/audio_display.cpp +++ b/aegisub/audio_display.cpp @@ -1354,7 +1354,13 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) { // Zoom if (zoom) { +#ifdef __APPLE__ + // Reverse scroll directions on Apple... ugly hack + // Otherwise left=right and right=left on systems that support four-way scrolling. int step = -event.GetWheelRotation() / event.GetWheelDelta(); +#else + int step = event.GetWheelRotation() / event.GetWheelDelta(); +#endif int value = box->HorizontalZoom->GetValue()+step; box->HorizontalZoom->SetValue(value); SetSamplesPercent(value,true,float(x)/float(w)); @@ -1362,7 +1368,7 @@ void AudioDisplay::OnMouseEvent(wxMouseEvent& event) { // Scroll else { - int step = event.GetWheelRotation() * w / 360; + int step = -event.GetWheelRotation() * w / 360; UpdatePosition(Position+step,false); UpdateImage(); }