Fix Quartz cursor going to +infinite if the window size was 0
This commit is contained in:
parent
5a5c815ff0
commit
8813ba69f5
|
@ -188,8 +188,8 @@ void KeyboardAndMouse::UpdateInput()
|
||||||
|
|
||||||
loc.x -= bounds.origin.x;
|
loc.x -= bounds.origin.x;
|
||||||
loc.y -= bounds.origin.y;
|
loc.y -= bounds.origin.y;
|
||||||
m_cursor.x = (loc.x / bounds.size.width * 2 - 1.0) * window_scale.x;
|
m_cursor.x = (loc.x / std::max(bounds.size.width, 1.0) * 2 - 1.0) * window_scale.x;
|
||||||
m_cursor.y = (loc.y / bounds.size.height * 2 - 1.0) * window_scale.y;
|
m_cursor.y = (loc.y / std::max(bounds.size.height, 1.0) * 2 - 1.0) * window_scale.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string KeyboardAndMouse::GetName() const
|
std::string KeyboardAndMouse::GetName() const
|
||||||
|
|
Loading…
Reference in New Issue