bill преди 1 година
родител
ревизия
69bae9f27d
променени са 2 файла, в които са добавени 9 реда и са изтрити 6 реда
  1. 2 1
      src/view/case/draw/selectFuseImage.vue
  2. 7 5
      src/view/case/help.ts

+ 2 - 1
src/view/case/draw/selectFuseImage.vue

@@ -104,7 +104,8 @@ const refreshBlob = async () => {
             fuseImage.blob,
             selectTaggings.value,
             width,
-            height
+            height,
+            scale
           );
   }
 };

+ 7 - 5
src/view/case/help.ts

@@ -221,7 +221,8 @@ export const fuseImageJoinHot = async (
   rawBlob: Blob,
   showTags: CaseTagging[],
   width = 500,
-  height = 390
+  height = 390,
+  scale = 1
 ) => {
   console.log(width, showTags);
   // fuse场景需要特别处理
@@ -247,11 +248,12 @@ export const fuseImageJoinHot = async (
     );
     if (index !== -1) {
       const bound = hot.getBoundingClientRect();
-      const wsize = (img.width / width) * 32;
-      const hsize = (img.height / height) * 32;
+      const hscale = img.width / contentDoc.body.offsetWidth;
+      const wsize = hscale * 32;
+      const hsize = hscale * 32;
 
-      const left = bound.left + wsize / 2;
-      const top = bound.top + hsize / 2;
+      const left = bound.left * hscale + wsize / 2;
+      const top = bound.top * hscale + hsize / 2;
       ctx.save();
       ctx.translate(left, top);
       ctx.beginPath();