mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-07 21:39:54 +02:00
ImDrawList: Fixed minor bug introduced in 1.75 where AddCircle() with 12 segments would generate an extra unrequired vertex.
Actual missing code for d3b37180a3
, thanks @domgho!
This commit is contained in:
@ -1235,7 +1235,7 @@ void ImDrawList::AddCircle(const ImVec2& center, float radius, ImU32 col, int nu
|
||||
// Because we are filling a closed shape we remove 1 from the count of segments/points
|
||||
const float a_max = (IM_PI * 2.0f) * ((float)num_segments - 1.0f) / (float)num_segments;
|
||||
if (num_segments == 12)
|
||||
PathArcToFast(center, radius - 0.5f, 0, 12);
|
||||
PathArcToFast(center, radius - 0.5f, 0, 12 - 1);
|
||||
else
|
||||
PathArcTo(center, radius - 0.5f, 0.0f, a_max, num_segments - 1);
|
||||
PathStroke(col, true, thickness);
|
||||
@ -1265,7 +1265,7 @@ void ImDrawList::AddCircleFilled(const ImVec2& center, float radius, ImU32 col,
|
||||
// Because we are filling a closed shape we remove 1 from the count of segments/points
|
||||
const float a_max = (IM_PI * 2.0f) * ((float)num_segments - 1.0f) / (float)num_segments;
|
||||
if (num_segments == 12)
|
||||
PathArcToFast(center, radius, 0, 12);
|
||||
PathArcToFast(center, radius, 0, 12 - 1);
|
||||
else
|
||||
PathArcTo(center, radius, 0.0f, a_max, num_segments - 1);
|
||||
PathFillConvex(col);
|
||||
|
Reference in New Issue
Block a user