|
@@ -171,7 +171,7 @@ const photo = async () => {
|
|
|
|
|
|
await saveAs(dataURL, `${relics.value?.name}.jpg`);
|
|
|
ElMessage.success("图片导出成功");
|
|
|
- setSize(devicePixelRatio);
|
|
|
+ setSize(1);
|
|
|
pano.changeEnv(thumbnailTexs.value);
|
|
|
pano.redraw();
|
|
|
loading.value = false;
|
|
@@ -185,8 +185,8 @@ let pano: ReturnType<typeof init>;
|
|
|
const setSize = (ration: number, w?: number, h?: number) => {
|
|
|
const canvas = panoDomRef.value!.parentElement;
|
|
|
|
|
|
- w = ((w || canvas.offsetWidth) * ration) / devicePixelRatio;
|
|
|
- h = ((h || canvas.offsetHeight) * ration) / devicePixelRatio;
|
|
|
+ w = (w || canvas.offsetWidth) * ration;
|
|
|
+ h = (h || canvas.offsetHeight) * ration;
|
|
|
pano.setSize([w, h]);
|
|
|
pano.redraw();
|
|
|
};
|
|
@@ -196,7 +196,7 @@ onMounted(() => {
|
|
|
if (!panoDomRef.value) throw "没有canvas DOM";
|
|
|
pano = init(panoDomRef.value);
|
|
|
const resizeHandler = () => {
|
|
|
- setSize(devicePixelRatio);
|
|
|
+ setSize(1);
|
|
|
};
|
|
|
resizeHandler();
|
|
|
|