Internals: Breaking: ImRect() default constructor initializes all fields with 0.0f

Instead of (FLT_MAX,FLT_MAX,-FLT_MAX,-FLT_MAX). Previous behavior was designed for adding into a bounding box but rarely relied on and not worth it.
This commit is contained in:
omar
2019-12-12 19:56:29 +01:00
parent 6fdde67be2
commit 43bd80a40d
3 changed files with 6 additions and 2 deletions

View File

@ -644,7 +644,7 @@ struct IMGUI_API ImRect
ImVec2 Min; // Upper-left
ImVec2 Max; // Lower-right
ImRect() : Min(FLT_MAX,FLT_MAX), Max(-FLT_MAX,-FLT_MAX) {}
ImRect() : Min(0.0f, 0.0f), Max(0.0f, 0.0f) {}
ImRect(const ImVec2& min, const ImVec2& max) : Min(min), Max(max) {}
ImRect(const ImVec4& v) : Min(v.x, v.y), Max(v.z, v.w) {}
ImRect(float x1, float y1, float x2, float y2) : Min(x1, y1), Max(x2, y2) {}