Blame view

天文台pc/tianwentai-ui/node_modules/motion-dom/dist/es/projection/geometry/utils.mjs 1 KB
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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