From e03d2b2900e9179c78c3d4fa281e7beb0d72d567 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 1 Apr 2015 15:56:58 +0100 Subject: [PATCH] ImVec2/ImVec4 no-parameters constructs init to 0.0f. Saner. Couldn't measure perf differences in a simple stress test compiled in Debug mode --- imgui.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui.h b/imgui.h index 283960a2..d237e09e 100644 --- a/imgui.h +++ b/imgui.h @@ -53,7 +53,7 @@ typedef int (*ImGuiTextEditCallback)(ImGuiTextEditCallbackData *data); struct ImVec2 { float x, y; - ImVec2() {} + ImVec2() { x = y = 0.0f; } ImVec2(float _x, float _y) { x = _x; y = _y; } #ifdef IM_VEC2_CLASS_EXTRA @@ -64,7 +64,7 @@ struct ImVec2 struct ImVec4 { float x, y, z, w; - ImVec4() {} + ImVec4() { x = y = z = w = 0.0f; } ImVec4(float _x, float _y, float _z, float _w) { x = _x; y = _y; z = _z; w = _w; } #ifdef IM_VEC4_CLASS_EXTRA