From 478435540c78c5c26d5ac44ca02f23ae06e4ea95 Mon Sep 17 00:00:00 2001 From: ocornut Date: Wed, 3 Jun 2020 21:31:40 +0200 Subject: [PATCH] Texture-based round corners: Fix UV coordinates used by RenderWindowResizeGrip() - render was broken --- imgui_draw.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/imgui_draw.cpp b/imgui_draw.cpp index b257ac66..188f26e8 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -5147,7 +5147,8 @@ bool ImGui::RenderWindowResizeGrip(ImDrawList* draw_list, const ImVec2& corner, // - uv[0] is the mid-point from the corner towards the center of the circle (solid) // - uv[1] is a solid point on the edge of the circle // - uv[2] is the outer edge (blank, outside the circle) - const ImVec4& uvs = (*draw_list->_Data->TexRoundCornerData)[rad - 1].TexUvFilled; + const unsigned int index = (rad - 1) * ImFontAtlasRoundCornersMaxStrokeWidth; + const ImVec4& uvs = (*draw_list->_Data->TexRoundCornerData)[index].TexUvFilled; const ImVec2 uv[] = { ImVec2(ImLerp(uvs.x, uvs.z, 0.5f), ImLerp(uvs.y, uvs.w, 0.5f)),