MCPcopy Create free account
hub / github.com/microsoft/SandDance / path$1

Function path$1

docs/app/js/sanddance-app.js:122738–122750  ·  view source on GitHub ↗
(context44, item)

Source from the content-addressed store, hash-verified

122736 emit9("d", item.path);
122737}
122738function path$1(context44, item) {
122739 var path9 = item.path;
122740 if (path9 == null) return true;
122741 var x37 = item.x || 0, y36 = item.y || 0, sx = item.scaleX || 1, sy = item.scaleY || 1, a = (item.angle || 0) * DegToRad, cache = item.pathCache;
122742 if (!cache || cache.path !== path9) (item.pathCache = cache = pathParse(path9)).path = path9;
122743 if (a && context44.rotate && context44.translate) {
122744 context44.translate(x37, y36);
122745 context44.rotate(a);
122746 pathRender(context44, cache, 0, 0, sx, sy);
122747 context44.rotate(-a);
122748 context44.translate(-x37, -y36);
122749 } else pathRender(context44, cache, x37, y36, sx, sy);
122750}
122751function bound$3(bounds11, item) {
122752 return path$1(boundContext(bounds11, item.angle), item) ? bounds11.set(0, 0, 0, 0) : boundStroke(bounds11, item, true);
122753}

Callers 1

bound$3Function · 0.70

Calls 4

pathParseFunction · 0.70
pathRenderFunction · 0.70
translateMethod · 0.45
rotateMethod · 0.45

Tested by

no test coverage detected