bill 9 months ago
parent
commit
d0caf612c6
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/view/pano/pano.vue

+ 3 - 2
src/view/pano/pano.vue

@@ -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();
 };