Add panorama previews and repair beta export rendering

This commit is contained in:
2026-10-04 23:12:34 +05:00
parent 763cf8713c
commit aec0641f87
21 changed files with 802 additions and 60 deletions

View File

@@ -82,6 +82,12 @@ export function Panorama({
);
};
let drag: { x: number; y: number } | null = null;
if (urls.length !== 6) {
callbacks.current.onError(
"This panorama is missing one or more of its six faces.",
);
return;
}
preloadFaces(urls)
.then((textures) => {
if (disposed) return;
@@ -134,11 +140,12 @@ export function Panorama({
element.addEventListener("wheel", wheel, { passive: false });
callbacks.current.onReady();
})
.catch((e) =>
.catch((e) => {
if (disposed) return;
callbacks.current.onError(
"Panorama could not load. " + (e instanceof Error ? e.message : ""),
),
);
);
});
return () => {
disposed = true;
cancelAnimationFrame(frame);
@@ -170,13 +177,13 @@ export function Panorama({
<>
<button
aria-label="Zoom in"
onClick={() => setFov((v) => Math.max(35, v - 10))}
onClick={() => setFov(Math.max(35, view.current.fov - 10))}
>
<Plus size={17} />
</button>
<button
aria-label="Zoom out"
onClick={() => setFov((v) => Math.min(100, v + 10))}
onClick={() => setFov(Math.min(100, view.current.fov + 10))}
>
<Minus size={17} />
</button>