mirror of
https://github.com/LizardByte/Sunshine.git
synced 2025-03-28 08:37:15 +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…
x
Reference in New Issue
Block a user