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

Function moveToNeighborCell

docs/app/js/sanddance-app.js:102428–102442  ·  view source on GitHub ↗
(cell, gridResolution, edge)

Source from the content-addressed store, hash-verified

102426 return out;
102427}
102428function moveToNeighborCell(cell, gridResolution, edge) {
102429 if (edge & 8) {
102430 cell[1] += gridResolution;
102431 cell[3] += gridResolution;
102432 } else if (edge & 4) {
102433 cell[1] -= gridResolution;
102434 cell[3] -= gridResolution;
102435 } else if (edge & 2) {
102436 cell[0] += gridResolution;
102437 cell[2] += gridResolution;
102438 } else if (edge & 1) {
102439 cell[0] -= gridResolution;
102440 cell[2] -= gridResolution;
102441 }
102442}
102443function getBoundingBox(positions, size, endIndex, out) {
102444 let minX = Infinity;
102445 let maxX = -Infinity;

Callers 1

cutPolylineByGridFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected