Fix normalization of touch coordinates

This commit is contained in:
Cameron Gutman 2023-09-17 15:56:50 -05:00
parent f8bfbb5b7c
commit 2427d4cef5

View File

@ -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());