MCPcopy Index your code
hub / github.com/microsoft/SandDance / attr

Function attr

docs/app/js/sanddance-app.js:122948–122956  ·  view source on GitHub ↗
(emit12, item)

Source from the content-addressed store, hash-verified

122946 return tempBounds;
122947}
122948function attr(emit12, item) {
122949 var dx = item.dx || 0, dy = (item.dy || 0) + offset(item), p = anchorPoint(item), x41 = p.x1, y40 = p.y1, a = item.angle || 0, t;
122950 emit12("text-anchor", textAlign[item.align] || "start");
122951 if (a) {
122952 t = translate(x41, y40) + " " + rotate(a);
122953 if (dx || dy) t += " " + translate(dx, dy);
122954 } else t = translate(x41 + dx, y40 + dy);
122955 emit12("transform", t);
122956}
122957function bound(bounds15, item, mode) {
122958 var h16 = textMetrics.height(item), a = item.align, p = anchorPoint(item), x42 = p.x1, y41 = p.y1, dx = item.dx || 0, dy = (item.dy || 0) + offset(item) - Math.round(0.8 * h16), // use 4/5 offset
122959 tl4 = textLines(item), w10; // get dimensions

Callers

nothing calls this directly

Calls 7

offsetFunction · 0.70
anchorPointFunction · 0.70
translateFunction · 0.70
rotateFunction · 0.70
fnFunction · 0.70
styleFunction · 0.70
forEachMethod · 0.45

Tested by

no test coverage detected