MCPcopy
hub / github.com/midrender/revideo / createPath

Method createPath

packages/2d/src/lib/components/Circle.ts:244–265  ·  view source on GitHub ↗
(expand = 0)

Source from the content-addressed store, hash-verified

242 }
243
244 protected createPath(expand = 0) {
245 const path = new Path2D();
246 const start = this.startAngle() * DEG2RAD;
247 let end = this.endAngle() * DEG2RAD;
248 const size = this.size().scale(0.5).add(expand);
249 const closed = this.closed();
250
251 if (end > start + Math.PI * 2) {
252 const loops = Math.floor((end - start) / (Math.PI * 2));
253 end -= Math.PI * 2 * loops;
254 }
255
256 if (closed) {
257 path.moveTo(0, 0);
258 }
259 path.ellipse(0, 0, size.x, size.y, 0, start, end, this.counterclockwise());
260 if (closed) {
261 path.closePath();
262 }
263
264 return path;
265 }
266}

Callers 2

getPathMethod · 0.95
getRipplePathMethod · 0.95

Calls 4

sizeMethod · 0.80
moveToMethod · 0.80
addMethod · 0.65
scaleMethod · 0.45

Tested by

no test coverage detected