Mission Control Dashboard - Initial implementation
This commit is contained in:
32
node_modules/motion-dom/dist/es/projection/geometry/utils.mjs
generated
vendored
Normal file
32
node_modules/motion-dom/dist/es/projection/geometry/utils.mjs
generated
vendored
Normal file
@@ -0,0 +1,32 @@
|
||||
import { calcLength } from './delta-calc.mjs';
|
||||
|
||||
function isAxisDeltaZero(delta) {
|
||||
return delta.translate === 0 && delta.scale === 1;
|
||||
}
|
||||
function isDeltaZero(delta) {
|
||||
return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y);
|
||||
}
|
||||
function axisEquals(a, b) {
|
||||
return a.min === b.min && a.max === b.max;
|
||||
}
|
||||
function boxEquals(a, b) {
|
||||
return axisEquals(a.x, b.x) && axisEquals(a.y, b.y);
|
||||
}
|
||||
function axisEqualsRounded(a, b) {
|
||||
return (Math.round(a.min) === Math.round(b.min) &&
|
||||
Math.round(a.max) === Math.round(b.max));
|
||||
}
|
||||
function boxEqualsRounded(a, b) {
|
||||
return axisEqualsRounded(a.x, b.x) && axisEqualsRounded(a.y, b.y);
|
||||
}
|
||||
function aspectRatio(box) {
|
||||
return calcLength(box.x) / calcLength(box.y);
|
||||
}
|
||||
function axisDeltaEquals(a, b) {
|
||||
return (a.translate === b.translate &&
|
||||
a.scale === b.scale &&
|
||||
a.originPoint === b.originPoint);
|
||||
}
|
||||
|
||||
export { aspectRatio, axisDeltaEquals, axisEquals, axisEqualsRounded, boxEquals, boxEqualsRounded, isDeltaZero };
|
||||
//# sourceMappingURL=utils.mjs.map
|
||||
Reference in New Issue
Block a user