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

Function getBoundingBox

docs/app/js/sanddance-app.js:102443–102461  ·  view source on GitHub ↗
(positions, size, endIndex, out)

Source from the content-addressed store, hash-verified

102441 }
102442}
102443function getBoundingBox(positions, size, endIndex, out) {
102444 let minX = Infinity;
102445 let maxX = -Infinity;
102446 let minY = Infinity;
102447 let maxY = -Infinity;
102448 for(let i = 0; i < endIndex; i += size){
102449 const x = positions[i];
102450 const y = positions[i + 1];
102451 minX = x < minX ? x : minX;
102452 maxX = x > maxX ? x : maxX;
102453 minY = y < minY ? y : minY;
102454 maxY = y > maxY ? y : maxY;
102455 }
102456 out[0][0] = minX;
102457 out[0][1] = minY;
102458 out[1][0] = maxX;
102459 out[1][1] = maxY;
102460 return out;
102461}
102462
102463},{"./lineclip":"1I8px","./utils":"7b2Ry","@parcel/transformer-js/src/esmodule-helpers.js":"jA2du"}],"aks6V":[function(require,module,exports) {
102464var parcelHelpers = require("@parcel/transformer-js/src/esmodule-helpers.js");

Callers 1

cutPolygonByGridFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected