summaryrefslogtreecommitdiff
path: root/Source/Core/InputCommon/ControllerInterface
diff options
context:
space:
mode:
authorFilippo Tarpini <filippotarpini@hotmail.it>2021-01-02 18:34:22 +0200
committerFiloppi <filippotarpini@hotmail.it>2021-01-02 19:55:19 +0200
commit8813ba69f5594180923cb2e2699ecd270a9cbd71 (patch)
treef3c8a60ab5745fd9590d8edcd18699b48c5c5877 /Source/Core/InputCommon/ControllerInterface
parent5a5c815ff037b4520d2ef90581b080d5d78e4b4f (diff)
Fix Quartz cursor going to +infinite if the window size was 0
Diffstat (limited to 'Source/Core/InputCommon/ControllerInterface')
-rw-r--r--Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm b/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm
index d594ac9e5f..216ae58e6c 100644
--- a/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm
+++ b/Source/Core/InputCommon/ControllerInterface/Quartz/QuartzKeyboardAndMouse.mm
@@ -188,8 +188,8 @@ void KeyboardAndMouse::UpdateInput()
loc.x -= bounds.origin.x;
loc.y -= bounds.origin.y;
- m_cursor.x = (loc.x / bounds.size.width * 2 - 1.0) * window_scale.x;
- m_cursor.y = (loc.y / bounds.size.height * 2 - 1.0) * window_scale.y;
+ m_cursor.x = (loc.x / std::max(bounds.size.width, 1.0) * 2 - 1.0) * window_scale.x;
+ m_cursor.y = (loc.y / std::max(bounds.size.height, 1.0) * 2 - 1.0) * window_scale.y;
}
std::string KeyboardAndMouse::GetName() const