[X11] Match win32 wheel coordinate system

OpenTK uses the win32 wheel coordinate system, where
(+h, +v) = (right, up). XI2 uses (+h, +v) = (right, down)
instead, so we need to flip the vertical offset.

Fixes issue #133 and https://github.com/mono/MonoGame/issues/2686
This commit is contained in:
thefiddler 2014-06-10 14:53:23 +02:00
parent b9e948580a
commit 525af589f1

View file

@ -544,7 +544,11 @@ namespace OpenTK.Platform.X11
d.State.X += (int)Math.Round(x);
d.State.Y += (int)Math.Round(y);
d.State.SetScrollRelative((float)h, (float)v);
// Note: OpenTK follows the windows scrolling convention where
// (+h, +v) = (right, up). XI2 uses (+h, +v) = (right, down)
// instead, so we need to flip the vertical offset.
d.State.SetScrollRelative((float)h, (float)(-v));
}
unsafe static double ReadRawValue(ref XIRawEvent raw, int bit)