mirror of
https://github.com/thinkonmay/sunshine-sdk.git
synced 2026-01-08 04:05:58 +00:00
Fix clamping mouse position to aspect ratio adjusted viewport
Fixes #1512
This commit is contained in:
parent
3fee592669
commit
eafb018516
@ -477,8 +477,8 @@ namespace input {
|
||||
auto offsetX = touch_port.client_offsetX;
|
||||
auto offsetY = touch_port.client_offsetY;
|
||||
|
||||
x = std::clamp(x, offsetX, size.first - offsetX);
|
||||
y = std::clamp(y, offsetY, size.second - offsetY);
|
||||
x = std::clamp(x, offsetX, (size.first * scalarX) - offsetX);
|
||||
y = std::clamp(y, offsetY, (size.second * scalarY) - offsetY);
|
||||
|
||||
return { (x - offsetX) * touch_port.scalar_inv, (y - offsetY) * touch_port.scalar_inv };
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user