From d9ef8300424e0f33995bdb51217b9ccffa00c9fb Mon Sep 17 00:00:00 2001 From: emmaus Date: Tue, 27 Feb 2018 19:18:55 +0000 Subject: [PATCH] adapt to screen size --- Ryujinx/Ui/GLScreen.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Ryujinx/Ui/GLScreen.cs b/Ryujinx/Ui/GLScreen.cs index f8bbd8920..c36013a8e 100644 --- a/Ryujinx/Ui/GLScreen.cs +++ b/Ryujinx/Ui/GLScreen.cs @@ -36,6 +36,9 @@ namespace Ryujinx JoystickPosition LeftJoystick; JoystickPosition RightJoystick; + float XScaleFactor = (1280 / (float)Width); + float YScaleFactor = (720 / (float)Height); + Touches CurrentTouchPoints = new Touches() { XTouches = new uint[Touches.Hid_Max_Num_Touches], @@ -98,7 +101,7 @@ namespace Ryujinx { if (Mouse.GetState().LeftButton == OpenTK.Input.ButtonState.Pressed && Focused) { - CurrentTouchPoints.AddTouch((uint)Mouse.X, (uint)Mouse.Y); + CurrentTouchPoints.AddTouch((uint)(Mouse.X * XScaleFactor), (uint)(Mouse.Y * YScaleFactor)); } }