mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-07-07 10:20:31 +00:00
[X11] Fixed core X11 scrolling and absolute y motions
This commit is contained in:
parent
9ae778a00f
commit
ffa3df29eb
|
@ -490,6 +490,8 @@ namespace OpenTK.Platform.X11
|
||||||
float dx, dy;
|
float dx, dy;
|
||||||
MouseButton button = X11KeyMap.TranslateButton(raw.detail, out dx, out dy);
|
MouseButton button = X11KeyMap.TranslateButton(raw.detail, out dx, out dy);
|
||||||
mouse.State[button] = raw.evtype == XIEventType.RawButtonPress;
|
mouse.State[button] = raw.evtype == XIEventType.RawButtonPress;
|
||||||
|
if (mouse.ScrollX.number == -1 && mouse.ScrollY.number == -1)
|
||||||
|
mouse.State.SetScrollRelative(dx, dy);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -554,7 +556,7 @@ namespace OpenTK.Platform.X11
|
||||||
d.State.X += (int)Math.Round(x);
|
d.State.X += (int)Math.Round(x);
|
||||||
else
|
else
|
||||||
d.State.X = (int)Math.Round(x);
|
d.State.X = (int)Math.Round(x);
|
||||||
if (d.MotionY.mode == XIMode.Absolute)
|
if (d.MotionY.mode == XIMode.Relative)
|
||||||
d.State.Y += (int)Math.Round(y);
|
d.State.Y += (int)Math.Round(y);
|
||||||
else
|
else
|
||||||
d.State.Y = (int)Math.Round(y);
|
d.State.Y = (int)Math.Round(y);
|
||||||
|
|
Loading…
Reference in a new issue