MCPcopy Create free account
hub / github.com/Samsung/rlottie / arcTo

Method arcTo

src/vector/vpath.cpp:152–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150static constexpr float K_PI = 3.141592f;
151
152void VPath::VPathData::arcTo(const VRectF &rect, float startAngle,
153 float sweepLength, bool forceMoveTo)
154{
155 size_t point_count = 0;
156 VPointF pts[15];
157 VPointF curve_start =
158 curvesForArc(rect, startAngle, sweepLength, pts, &point_count);
159
160 reserve(point_count + 1, point_count / 3 + 1);
161 if (empty() || forceMoveTo) {
162 moveTo(curve_start.x(), curve_start.y());
163 } else {
164 lineTo(curve_start.x(), curve_start.y());
165 }
166 for (size_t i = 0; i < point_count; i += 3) {
167 cubicTo(pts[i].x(), pts[i].y(), pts[i + 1].x(), pts[i + 1].y(),
168 pts[i + 2].x(), pts[i + 2].y());
169 }
170}
171
172void VPath::VPathData::addCircle(float cx, float cy, float radius,
173 VPath::Direction dir)

Callers

nothing calls this directly

Calls 5

curvesForArcFunction · 0.85
reserveFunction · 0.85
emptyFunction · 0.85
xMethod · 0.45
yMethod · 0.45

Tested by

no test coverage detected