MCPcopy Create free account
hub / github.com/microsoft/SandDance / markItemPath

Function markItemPath

docs/app/js/sanddance-app.js:122410–122438  ·  view source on GitHub ↗
(type3, shape1, isect)

Source from the content-addressed store, hash-verified

122408 return translate(item.x || 0, item.y || 0) + (item.angle ? " " + rotate(item.angle) : "") + (item.scaleX || item.scaleY ? " " + scale(item.scaleX || 1, item.scaleY || 1) : "");
122409}
122410function markItemPath(type3, shape1, isect) {
122411 function attr1(emit1, item) {
122412 emit1("transform", rotateItem(item));
122413 emit1("d", shape1(null, item));
122414 }
122415 function bound1(bounds5, item) {
122416 shape1(boundContext(bounds5, item.angle), item);
122417 return boundStroke(bounds5, item).translate(item.x || 0, item.y || 0);
122418 }
122419 function draw2(context35, item) {
122420 var x29 = item.x || 0, y28 = item.y || 0, a = item.angle || 0;
122421 context35.translate(x29, y28);
122422 if (a) context35.rotate(a *= DegToRad);
122423 context35.beginPath();
122424 shape1(context35, item);
122425 if (a) context35.rotate(-a);
122426 context35.translate(-x29, -y28);
122427 }
122428 return {
122429 type: type3,
122430 tag: "path",
122431 nested: false,
122432 attr: attr1,
122433 bound: bound1,
122434 draw: drawAll(draw2),
122435 pick: pickPath(draw2),
122436 isect: isect || intersectPath(draw2)
122437 };
122438}
122439var arc = markItemPath("arc", arc$1);
122440function pickArea(a, p) {
122441 var v = a[0].orient === "horizontal" ? p[1] : p[0], z = a[0].orient === "horizontal" ? "y" : "x", i = a.length, min = Infinity, hit2, d;

Callers 1

sanddance-app.jsFile · 0.70

Calls 3

drawAllFunction · 0.70
pickPathFunction · 0.70
intersectPathFunction · 0.70

Tested by

no test coverage detected