mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-11 05:45:57 +00:00
[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:
parent
b9e948580a
commit
525af589f1
|
@ -544,7 +544,11 @@ namespace OpenTK.Platform.X11
|
||||||
|
|
||||||
d.State.X += (int)Math.Round(x);
|
d.State.X += (int)Math.Round(x);
|
||||||
d.State.Y += (int)Math.Round(y);
|
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)
|
unsafe static double ReadRawValue(ref XIRawEvent raw, int bit)
|
||||||
|
|
Loading…
Reference in a new issue