diff --git a/docs/CHANGELOG.txt b/docs/CHANGELOG.txt index 2b3ee5962..60b1806b8 100644 --- a/docs/CHANGELOG.txt +++ b/docs/CHANGELOG.txt @@ -130,6 +130,9 @@ Other Changes: as a convenience for when using e.g. InvisibleButton(). - Focus: fixed fallback "Debug" window temporarily taking focus and setting io.WantCaptureKeyboard for one frame on e.g. application boot if no other windows are submitted. (#9243) +- DrawList: + - PathArcTo(): fixed erroneous segment count for pathologically small arcs on large + circles. (#9331, #9313) [@thedmd, @epajarre] - Memory: - Discard/GC of ImDrawList buffers for unused windows favor restoring them to ~Size*1.05 instead of Capacity when awakening again. Facilitate releasing ImDrawList diff --git a/imgui_draw.cpp b/imgui_draw.cpp index 3a15fcd75..680d6af02 100644 --- a/imgui_draw.cpp +++ b/imgui_draw.cpp @@ -1312,7 +1312,7 @@ void ImDrawList::PathArcTo(const ImVec2& center, float radius, float a_min, floa { const float arc_length = ImAbs(a_max - a_min); const int circle_segment_count = _CalcCircleAutoSegmentCount(radius); - const int arc_segment_count = ImMax((int)ImCeil(circle_segment_count * arc_length / (IM_PI * 2.0f)), (int)(2.0f * IM_PI / arc_length)); + const int arc_segment_count = ImMax((int)ImCeil(circle_segment_count * arc_length / (IM_PI * 2.0f)), 1); _PathArcToN(center, radius, a_min, a_max, arc_segment_count); } }