mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-15 01:17:00 +00:00
Silence XCode static analysis false positive (#2309)
This commit is contained in:
parent
8a605354ef
commit
13ca2fe845
@ -4144,6 +4144,9 @@ ImVec2 ImGui::GetMousePosOnOpeningCurrentPopup()
|
||||
// We typically use ImVec2(-FLT_MAX,-FLT_MAX) to denote an invalid mouse position.
|
||||
bool ImGui::IsMousePosValid(const ImVec2* mouse_pos)
|
||||
{
|
||||
// The assert is only to silence a false-positive in XCode Static Analysis.
|
||||
// Because GImGui is not dereferenced in every code path, the static analyzer assume that it may be NULL (which it doesn't for other functions).
|
||||
IM_ASSERT(GImGui != NULL);
|
||||
const float MOUSE_INVALID = -256000.0f;
|
||||
ImVec2 p = mouse_pos ? *mouse_pos : GImGui->IO.MousePos;
|
||||
return p.x >= MOUSE_INVALID && p.y >= MOUSE_INVALID;
|
||||
|
Loading…
Reference in New Issue
Block a user