From 13fd81acae506ce5d4b3d955e4ab509b4ad93de6 Mon Sep 17 00:00:00 2001 From: Mikko Mononen Date: Wed, 3 Jun 2026 00:28:23 +0300 Subject: [PATCH] DrawList: fixed reserve counts in _AddPolyline(). --- imgui_draw.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 35cfd515b..8d6ef3630 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -940,8 +940,8 @@ void ImDrawList::_AddPolyline(const ImVec2* points, ImVec2* normals, float* sqr_ } else { - vtx_count = /*body*/(points_count - 2) * max_verts_per_point + /*caps*/(6 * 2); - idx_count = (/*body*/(points_count - 2) * max_tris_per_point + /*last seg*/4 + /*caps*/(4 * 2)) * 3; + vtx_count = /*body*/(points_count - 2) * max_verts_per_point + /*caps*/(4 * 2); + idx_count = (/*body*/(points_count - 2) * max_tris_per_point + /*last seg*/2 + /*caps*/(2 * 2)) * 3; }