From 2427d4cef55dc636352b103480c580b905d2e9a7 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 17 Sep 2023 15:56:50 -0500 Subject: [PATCH] Fix normalization of touch coordinates --- input.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/input.cpp b/input.cpp index aa2c4c9..43ef383 100644 --- a/input.cpp +++ b/input.cpp @@ -194,8 +194,8 @@ bool MoonlightInstance::TryHandleNativeTouchEvent(const pp::InputEvent& event) { pp::TouchPoint touchPoint = touchEvent.GetTouchByIndex(PP_TOUCHLIST_TYPE_CHANGEDTOUCHES, i); pp::FloatPoint touchPos = touchPoint.position(); LiSendTouchEvent(eventType, touchPoint.id(), - MIN(MAX(touchPos.x(), 0), m_PluginRect.width()), - MIN(MAX(touchPos.y(), 0), m_PluginRect.height()), + MIN(MAX(touchPos.x(), 0), m_PluginRect.width()) / m_PluginRect.width(), + MIN(MAX(touchPos.y(), 0), m_PluginRect.height()) / m_PluginRect.height(), touchPoint.pressure(), 0.0f, 0.0f, touchPoint.rotation_angle());