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

Function cloudBounds

docs/app/js/sanddance-app.js:140959–140965  ·  view source on GitHub ↗
(bounds, d)

Source from the content-addressed store, hash-verified

140957 return false;
140958}
140959function cloudBounds(bounds, d) {
140960 var b0 = bounds[0], b1 = bounds[1];
140961 if (d.x + d.x0 < b0.x) b0.x = d.x + d.x0;
140962 if (d.y + d.y0 < b0.y) b0.y = d.y + d.y0;
140963 if (d.x + d.x1 > b1.x) b1.x = d.x + d.x1;
140964 if (d.y + d.y1 > b1.y) b1.y = d.y + d.y1;
140965}
140966function collideRects(a, b) {
140967 return a.x + a.x1 > b[0].x && a.x + a.x0 < b[1].x && a.y + a.y1 > b[0].y && a.y + a.y0 < b[1].y;
140968}

Callers 1

cloudFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected