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

Function getContext

docs/app/js/sanddance-app.js:140765–140777  ·  view source on GitHub ↗
(canvas)

Source from the content-addressed store, hash-verified

140763 return tags;
140764 };
140765 function getContext(canvas) {
140766 canvas.width = canvas.height = 1;
140767 var ratio = Math.sqrt(canvas.getContext("2d").getImageData(0, 0, 1, 1).data.length >> 2);
140768 canvas.width = (cw << 5) / ratio;
140769 canvas.height = ch / ratio;
140770 var context = canvas.getContext("2d");
140771 context.fillStyle = context.strokeStyle = "red";
140772 context.textAlign = "center";
140773 return {
140774 context: context,
140775 ratio: ratio
140776 };
140777 }
140778 function place(board, tag, bounds) {
140779 var startX = tag.x, startY = tag.y, maxDelta = Math.sqrt(size[0] * size[0] + size[1] * size[1]), s = spiral(size), dt = random() < .5 ? 1 : -1, t = -dt, dxdy, dx, dy;
140780 while(dxdy = s(t += dt)){

Callers 1

cloudFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected