decord/alpha/source/modules/zoom_layout/ZoomLayout.android.tsx

57 lines
1.5 KiB
TypeScript
Raw Normal View History

// Module ID: 9700
// Function ID: 9701
// Name: ZoomLayout
// Dependencies: [19, 17, 21, 9701, 2]
2026-07-20 16:05:17 +00:00
// Module 9700 (ZoomLayout)
import ZoomLayoutNativeComponentDefault from "ZoomLayoutNativeComponent" /* 9701 */;
import noop from "module_19" /* 19 */;
2026-07-23 10:11:24 +00:00
const require = fn;
const PixelRatio = fn(17).PixelRatio;
const jsx = fn(21).jsx;
const size = fn(2);
let result = size.fileFinishedImporting("modules/zoom_layout/ZoomLayout.android.tsx");
export default noop.forwardRef((arg0, ref) => {
ref = noop.useRef(null);
const imperativeHandle = noop.useImperativeHandle(ref, () => ({
2026-07-20 16:05:17 +00:00
zoomTo(scale) {
let num = scale.scale;
({ x, y } = scale);
if (num === undefined) {
num = 2;
}
let flag = scale.animated;
if (flag === undefined) {
flag = true;
}
2026-07-29 08:29:29 +00:00
if (null != ref.current) {
value = PixelRatio.get();
2026-07-20 16:05:17 +00:00
const result = x * value;
const result1 = y * value;
const Commands = ref(9701).Commands;
2026-07-29 08:29:29 +00:00
Commands.zoomTo(tmp.current, result / num - result, result1 / num - result1, num, flag);
2026-07-20 16:05:17 +00:00
}
},
unzoom() {
let obj = arg0;
if (arg0 === undefined) {
obj = {};
}
let flag = obj.animated;
if (flag === undefined) {
flag = true;
}
2026-07-29 08:29:29 +00:00
if (null != ref.current) {
const Commands = ref(9701).Commands;
2026-07-29 08:29:29 +00:00
Commands.unzoom(tmp.current, flag);
2026-07-20 16:05:17 +00:00
}
}
}));
2026-07-23 10:11:24 +00:00
let obj = {};
2026-07-20 16:05:17 +00:00
const merged = Object.assign(arg0);
2026-07-29 08:29:29 +00:00
obj.ref = ref;
return jsx(ZoomLayoutNativeComponentDefault, {});
2026-07-20 16:05:17 +00:00
});