MCPcopy
hub / github.com/tdewolff/minify / getCanvasGradient

Function getCanvasGradient

_benchmarks/sample_echarts.js:26532–26541  ·  view source on GitHub ↗
(ctx, obj, rect)

Source from the content-addressed store, hash-verified

26530 return canvasGradient;
26531 }
26532 function getCanvasGradient(ctx, obj, rect) {
26533 var canvasGradient = obj.type === 'radial'
26534 ? createRadialGradient(ctx, obj, rect)
26535 : createLinearGradient(ctx, obj, rect);
26536 var colorStops = obj.colorStops;
26537 for (var i = 0; i < colorStops.length; i++) {
26538 canvasGradient.addColorStop(colorStops[i].offset, colorStops[i].color);
26539 }
26540 return canvasGradient;
26541 }
26542 function isClipPathChanged(clipPaths, prevClipPaths) {
26543 if (clipPaths === prevClipPaths || (!clipPaths && !prevClipPaths)) {
26544 return false;

Callers 2

brushPathFunction · 0.85
doClearFunction · 0.85

Calls 2

createRadialGradientFunction · 0.85
createLinearGradientFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…