fix: lazy load 3d view
This commit is contained in:
parent
e4b3cce517
commit
738f814ecb
@ -7,7 +7,6 @@
|
|||||||
imageToArray,
|
imageToArray,
|
||||||
} from "helpers";
|
} from "helpers";
|
||||||
import { images as imageStore } from "stores";
|
import { images as imageStore } from "stores";
|
||||||
import OrbView from "./OrbView";
|
|
||||||
import { onMount } from "svelte";
|
import { onMount } from "svelte";
|
||||||
import Toast from "components/Toast";
|
import Toast from "components/Toast";
|
||||||
import { throttle } from "lodash";
|
import { throttle } from "lodash";
|
||||||
@ -263,11 +262,14 @@
|
|||||||
polygonPoints.length === 2 ? cx1.stroke() : cx1.fill();
|
polygonPoints.length === 2 ? cx1.stroke() : cx1.fill();
|
||||||
}
|
}
|
||||||
|
|
||||||
function switchViewMode(e: MouseEvent) {
|
let OrbView;
|
||||||
|
async function switchViewMode(e: MouseEvent) {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
e.stopImmediatePropagation();
|
e.stopImmediatePropagation();
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
|
||||||
|
if (!OrbView) OrbView = (await import("./OrbView")).default;
|
||||||
|
|
||||||
mode = mode === "2d" ? "3d" : "2d";
|
mode = mode === "2d" ? "3d" : "2d";
|
||||||
|
|
||||||
if (mode === "3d") {
|
if (mode === "3d") {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user