From e7e2fcdd19bb8d71ff79d0979605ccab1fc0e26b Mon Sep 17 00:00:00 2001 From: ocornut Date: Mon, 6 Jul 2015 20:59:01 -0600 Subject: [PATCH] ImRect (internal) made constructors more non-optimised compilation friendly --- imgui.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 3fe021d52..7e3813e8e 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -1058,10 +1058,10 @@ struct ImRect // 2D axis aligned bounding-box ImVec2 Min; ImVec2 Max; - ImRect() { Min = ImVec2(FLT_MAX,FLT_MAX); Max = ImVec2(-FLT_MAX,-FLT_MAX); } - ImRect(const ImVec2& min, const ImVec2& max) { Min = min; Max = max; } - ImRect(const ImVec4& v) { Min.x = v.x; Min.y = v.y; Max.x = v.z; Max.y = v.w; } - ImRect(float x1, float y1, float x2, float y2) { Min.x = x1; Min.y = y1; Max.x = x2; Max.y = y2; } + ImRect() : Min(FLT_MAX,FLT_MAX), Max(-FLT_MAX,-FLT_MAX) {} + ImRect(const ImVec2& min, const ImVec2& max) : Min(min), Max(max) {} + ImRect(const ImVec4& v) : Min(v.x, v.y), Max(v.z, v.z) {} + ImRect(float x1, float y1, float x2, float y2) : Min(x1,y1), Max(x2, y2) {} ImVec2 GetCenter() const { return ImVec2((Min.x+Max.x)*0.5f, (Min.y+Max.y)*0.5f); } ImVec2 GetSize() const { return ImVec2(Max.x-Min.x,Max.y-Min.y); }