10 : bounds_(bounds), include_center_(include_center) {
44const Arc::Iteration Arc::ComputeCircleArcIterations(
size_t step_count) {
65 Degrees end_angle = start_angle + sweep_;
79 if (include_center_) {
80 extrema[count++] = {0, 0};
84 int cur_axis = std::floor(start_angle.
degrees / 90.0f);
86 int end_axis = std::ceil(end_angle.
degrees / 90.0f);
87 while (++cur_axis < end_axis) {
96 for (
int i = 0;
i < count;
i++) {
97 extrema[
i] = center + extrema[
i] * radii;
103 bool simplify_360)
const {
110 if (simplify_360 && sweep_.
degrees >= 360) {
111 return ComputeCircleArcIterations(step_count);
130 if ((
start + nudge) >= (
end - nudge)) {
136 static_cast<int>(std::floor((
start + nudge).degrees / 90.0f));
138 static_cast<int>(std::floor((
end - nudge).degrees / 90.0f));
142 end_quadrant <= cur_quadrant + 8);
146 auto next_step = [step_count](
Degrees angle,
int quadrant) ->
size_t {
148 return static_cast<size_t>(std::ceil(quadrant_fract * step_count));
154 next_step(
start + nudge, cur_quadrant),
160 while (cur_quadrant < end_quadrant) {
170 next_step(
end - nudge, cur_quadrant);
#define FML_DCHECK(condition)
static constexpr impeller::Vector2 kQuadrantAxes[4]
size_t GetPointCount() const
size_t GetPointCount() const
Iteration ComputeIterations(size_t step_count, bool simplify_360=true) const
Arc(const Rect &bounds, Degrees start, Degrees sweep, bool include_center)
Rect GetTightArcBounds() const
constexpr bool IsFullCircle() const
constexpr bool IsFinite() const
constexpr Degrees GetPositive() const
static Vector2 CosSin(Radians radians)
constexpr TSize< Type > GetSize() const
Returns the size of the rectangle which may be negative in either width or height and may have been c...
IsFinite() const
Returns true if all of the fields of this floating point rectangle are finite.
static constexpr std::optional< TRect > MakePointBounds(const U &value)
constexpr Point GetCenter() const
Get the center point as a |Point|.