DrawList: PathArcTo(): fixed erroneous segment count for small arcs on large circles. (#9331, #9313)

This commit is contained in:
thedmd
2026-03-29 10:20:24 +02:00
committed by ocornut
parent b62cf3894b
commit bd3c925680
2 changed files with 4 additions and 1 deletions

View File

@@ -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);
}
}