bill 9 tháng trước cách đây
mục cha
commit
d0caf612c6
1 tập tin đã thay đổi với 3 bổ sung2 xóa
  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();
 };