MCPcopy Create free account
hub / github.com/chartjs/Chart.js / strokePathWithCache

Function strokePathWithCache

src/elements/element.line.ts:219–229  ·  view source on GitHub ↗
(ctx: CanvasRenderingContext2D, line: LineElement, start?: number, count?: number)

Source from the content-addressed store, hash-verified

217}
218
219function strokePathWithCache(ctx: CanvasRenderingContext2D, line: LineElement, start?: number, count?: number) {
220 let path = line._path;
221 if (!path) {
222 path = line._path = new Path2D();
223 if (line.path(path, start, count)) {
224 path.closePath();
225 }
226 }
227 setStyle(ctx, line.options);
228 ctx.stroke(path);
229}
230
231function strokePathDirect(ctx: CanvasRenderingContext2D, line: LineElement, start?: number, count?: number) {
232 const {segments, options} = line;

Callers 1

drawFunction · 0.85

Calls 2

setStyleFunction · 0.85
pathMethod · 0.65

Tested by

no test coverage detected