Browse Source

fix: 添加图纸的比例打印

bill 2 months ago
parent
commit
c703400617
1 changed files with 5 additions and 10 deletions
  1. 5 10
      src/example/fuse/views/tabulation/index.vue

+ 5 - 10
src/example/fuse/views/tabulation/index.vue

@@ -105,16 +105,6 @@ const init = async (draw: Draw) => {
     },
   });
   inited.value = true;
-
-  draw.runHook(() => {
-    const size = useViewBoxPixelRect();
-    quitMerges.push(
-      watchEffect(() => {
-        console.log("当前视口:", size.value);
-      })
-    );
-  });
-
   quitMerges.push(tabCustomStyle(p, draw));
   return () => mergeFuns(quitMerges)();
 };
@@ -164,6 +154,11 @@ watch(cover, (cover, _, onCleanup) => {
   const mountMenus = draw.value.mountFilter;
   const menusFilter = draw.value.menusFilter;
   const quits = [
+    watchEffect(() => {
+      console.log("当前图片宽高:", cover.width, cover.height);
+      console.log("当前图片真实宽高:", cover.widthRaw, cover.heightRaw);
+      console.log("当前图片比例:", { ...cover.proportion });
+    }),
     menusFilter.setShapeMenusFilter(cover.id, () => []),
     mountMenus.setShapeMenusFilter(cover.id, (des) => ({
       ...des,