MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / AddCircleFilled

Method AddCircleFilled

extern/imgui/imgui_draw.cpp:1506–1528  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1504}
1505
1506void ImDrawList::AddCircleFilled(const ImVec2& center, float radius, ImU32 col, int num_segments)
1507{
1508 if ((col & IM_COL32_A_MASK) == 0 || radius < 0.5f)
1509 return;
1510
1511 if (num_segments <= 0)
1512 {
1513 // Use arc with automatic segment count
1514 _PathArcToFastEx(center, radius, 0, IM_DRAWLIST_ARCFAST_SAMPLE_MAX, 0);
1515 _Path.Size--;
1516 }
1517 else
1518 {
1519 // Explicit segment count (still clamp to avoid drawing insanely tessellated shapes)
1520 num_segments = ImClamp(num_segments, 3, IM_DRAWLIST_CIRCLE_AUTO_SEGMENT_MAX);
1521
1522 // Because we are filling a closed shape we remove 1 from the count of segments/points
1523 const float a_max = (IM_PI * 2.0f) * ((float)num_segments - 1.0f) / (float)num_segments;
1524 PathArcTo(center, radius, 0.0f, a_max, num_segments - 1);
1525 }
1526
1527 PathFillConvex(col);
1528}
1529
1530// Guaranteed to honor 'num_segments'
1531void ImDrawList::AddNgon(const ImVec2& center, float radius, ImU32 col, int num_segments, float thickness)

Callers 7

NavUpdateMethod · 0.80
RenderBulletMethod · 0.80
CloseButtonMethod · 0.80
CollapseButtonMethod · 0.80
RadioButtonMethod · 0.80
ColorPicker4Method · 0.80

Calls 1

ImClampFunction · 0.85

Tested by

no test coverage detected