From bed55a41e1e5ef2242d2f1a3a1d93254ffd1953b Mon Sep 17 00:00:00 2001 From: omar Date: Mon, 5 Feb 2018 14:51:28 +0100 Subject: [PATCH] Internals: ImRect: Added IsInverted() helper. --- imgui_internal.h | 1 + 1 file changed, 1 insertion(+) diff --git a/imgui_internal.h b/imgui_internal.h index 37a31bff..f904cbcf 100644 --- a/imgui_internal.h +++ b/imgui_internal.h @@ -285,6 +285,7 @@ struct IMGUI_API ImRect void ClipWithFull(const ImRect& r) { Min = ImClamp(Min, r.Min, r.Max); Max = ImClamp(Max, r.Min, r.Max); } // Full version, ensure both points are fully clipped. void Floor() { Min.x = (float)(int)Min.x; Min.y = (float)(int)Min.y; Max.x = (float)(int)Max.x; Max.y = (float)(int)Max.y; } void FixInverted() { if (Min.x > Max.x) ImSwap(Min.x, Max.x); if (Min.y > Max.y) ImSwap(Min.y, Max.y); } + bool IsInverted() const { return Min.x > Max.x || Min.y > Max.y; } bool IsFinite() const { return Min.x != FLT_MAX; } };