Fix clamping mouse position to aspect ratio adjusted viewport
Fixes #1512
This commit is contained in:
parent
3fee592669
commit
eafb018516
1 changed files with 2 additions and 2 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue