mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-17 22:23:31 +00:00
Fix scaling of touch coordinates
This commit is contained in:
@@ -78,6 +78,7 @@ void SdlInputHandler::handleAbsoluteFingerEvent(SDL_TouchFingerEvent* event)
|
|||||||
dst.h = windowHeight;
|
dst.h = windowHeight;
|
||||||
|
|
||||||
// Scale window-relative events to be video-relative and clamp to video region
|
// Scale window-relative events to be video-relative and clamp to video region
|
||||||
|
StreamUtils::scaleSourceToDestinationSurface(&src, &dst);
|
||||||
float vidrelx = qMin(qMax((int)(event->x * windowWidth), dst.x), dst.x + dst.w) - dst.x;
|
float vidrelx = qMin(qMax((int)(event->x * windowWidth), dst.x), dst.x + dst.w) - dst.x;
|
||||||
float vidrely = qMin(qMax((int)(event->y * windowHeight), dst.y), dst.y + dst.h) - dst.y;
|
float vidrely = qMin(qMax((int)(event->y * windowHeight), dst.y), dst.y + dst.h) - dst.y;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user