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

Function getDistanceBetweenPoints

docs/app/js/sanddance-app.js:25572–25579  ·  view source on GitHub ↗
(point1, point2)

Source from the content-addressed store, hash-verified

25570 * @param precision - The number of decimal places to round the number to
25571 */ parcelHelpers.export(exports, "precisionRound", ()=>precisionRound);
25572function getDistanceBetweenPoints(point1, point2) {
25573 var left1 = point1.left || point1.x || 0;
25574 var top1 = point1.top || point1.y || 0;
25575 var left2 = point2.left || point2.x || 0;
25576 var top2 = point2.top || point2.y || 0;
25577 /* eslint-enable deprecation/deprecation */ var distance = Math.sqrt(Math.pow(left1 - left2, 2) + Math.pow(top1 - top2, 2));
25578 return distance;
25579}
25580function fitContentToBounds(options) {
25581 var contentSize = options.contentSize, boundsSize = options.boundsSize, _a = options.mode, mode = _a === void 0 ? "contain" : _a, _b = options.maxScale, maxScale = _b === void 0 ? 1 : _b;
25582 var contentAspectRatio = contentSize.width / contentSize.height;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected