|
@@ -184,8 +184,9 @@ const photo = async () => {
|
|
|
let pano: ReturnType<typeof init>;
|
|
|
const setSize = (ration: number, w?: number, h?: number) => {
|
|
|
const canvas = panoDomRef.value!.parentElement;
|
|
|
- w = (w || canvas.offsetWidth) * ration;
|
|
|
- h = (h || canvas.offsetHeight) * ration;
|
|
|
+
|
|
|
+ w = ((w || canvas.offsetWidth) * ration) / devicePixelRatio;
|
|
|
+ h = ((h || canvas.offsetHeight) * ration) / devicePixelRatio;
|
|
|
pano.setSize([w, h]);
|
|
|
pano.redraw();
|
|
|
};
|