MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / AddNgon

Method AddNgon

lib/imgui/imgui_draw.cpp:1164–1173  ·  view source on GitHub ↗

Guaranteed to honor 'num_segments'

Source from the content-addressed store, hash-verified

1162
1163// Guaranteed to honor 'num_segments'
1164void ImDrawList::AddNgon(const ImVec2& center, float radius, ImU32 col, int num_segments, float thickness)
1165{
1166 if ((col & IM_COL32_A_MASK) == 0 || num_segments <= 2)
1167 return;
1168
1169 // Because we are filling a closed shape we remove 1 from the count of segments/points
1170 const float a_max = (IM_PI * 2.0f) * ((float)num_segments - 1.0f) / (float)num_segments;
1171 PathArcTo(center, radius - 0.5f, 0.0f, a_max, num_segments - 1);
1172 PathStroke(col, true, thickness);
1173}
1174
1175// Guaranteed to honor 'num_segments'
1176void ImDrawList::AddNgonFilled(const ImVec2& center, float radius, ImU32 col, int num_segments)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected