Blame view

天文台pc/tianwentai-ui/node_modules/motion-dom/dist/es/animation/drivers/frame.mjs 662 Bytes
bc518174   王天杨   提交两个项目文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
  import { time } from '../../frameloop/sync-time.mjs';
  import { frameData, cancelFrame, frame } from '../../frameloop/frame.mjs';
  
  const frameloopDriver = (update) => {
      const passTimestamp = ({ timestamp }) => update(timestamp);
      return {
          start: (keepAlive = true) => frame.update(passTimestamp, keepAlive),
          stop: () => cancelFrame(passTimestamp),
          /**
           * If we're processing this frame we can use the
           * framelocked timestamp to keep things in sync.
           */
          now: () => (frameData.isProcessing ? frameData.timestamp : time.now()),
      };
  };
  
  export { frameloopDriver };
  //# sourceMappingURL=frame.mjs.map