From fdc8c0722fd914eea311882d86ac03d5677e8aaf Mon Sep 17 00:00:00 2001 From: Mikko Mononen Date: Tue, 6 Jan 2015 19:24:57 +0200 Subject: [PATCH] Compile fixes --- imgui.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 33be1f940..27e75f21d 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -5891,9 +5891,9 @@ void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32 const ImVec2& v0 = points[i]; const ImVec2& v1 = points[ni]; ImVec2 diff = v1 - v0; - float d = ImLength(diff); + float d = ImLengthSqr(diff); if (d > 0) - diff *= 1.0f/d; + diff *= 1.0f/sqrtf(d); temp_normals[i].x = diff.y; temp_normals[i].y = -diff.x; } @@ -5925,10 +5925,6 @@ void ImDrawList::AddPolyline(const ImVec2* points, const int points_count, ImU32 temp_inner[ni] = points[ni] - dm; } - if (!closed) - { - } - const ImU32 col_trans = col & 0x00ffffff; int vertex_count = count*12; @@ -5972,9 +5968,9 @@ void ImDrawList::AddConvexPolyFilled(const ImVec2* points, const int points_coun const ImVec2& v0 = points[j]; const ImVec2& v1 = points[i]; ImVec2 diff = v1 - v0; - float d = ImLength(diff); + float d = ImLengthSqr(diff); if (d > 0) - diff *= 1.0f/d; + diff *= 1.0f/sqrtf(d); temp_normals[j].x = diff.y; temp_normals[j].y = -diff.x; }