UNPKG

895 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.useCurrentFrame = exports.useAbsoluteCurrentFrame = void 0;
4const react_1 = require("react");
5const sequencing_1 = require("./sequencing");
6const timeline_position_state_1 = require("./timeline-position-state");
7const useAbsoluteCurrentFrame = () => {
8 const timelinePosition = (0, timeline_position_state_1.useTimelinePosition)();
9 return timelinePosition;
10};
11exports.useAbsoluteCurrentFrame = useAbsoluteCurrentFrame;
12const useCurrentFrame = () => {
13 const frame = (0, exports.useAbsoluteCurrentFrame)();
14 const context = (0, react_1.useContext)(sequencing_1.SequenceContext);
15 const contextOffset = context
16 ? context.cumulatedFrom + context.relativeFrom
17 : 0;
18 return frame - contextOffset;
19};
20exports.useCurrentFrame = useCurrentFrame;
21//# sourceMappingURL=use-frame.js.map
\No newline at end of file