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