1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.useCurrentFrame = exports.useAbsoluteCurrentFrame = void 0;
|
4 | const react_1 = require("react");
|
5 | const sequencing_1 = require("./sequencing");
|
6 | const timeline_position_state_1 = require("./timeline-position-state");
|
7 | const useAbsoluteCurrentFrame = () => {
|
8 | const timelinePosition = (0, timeline_position_state_1.useTimelinePosition)();
|
9 | return timelinePosition;
|
10 | };
|
11 | exports.useAbsoluteCurrentFrame = useAbsoluteCurrentFrame;
|
12 | const 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 | };
|
20 | exports.useCurrentFrame = useCurrentFrame;
|
21 |
|
\ | No newline at end of file |