liyongli 1 ano atrás
pai
commit
cf8377c1a8
1 arquivos alterados com 6 adições e 2 exclusões
  1. 6 2
      src/view/allMedia/imageProcessing/detail.vue

+ 6 - 2
src/view/allMedia/imageProcessing/detail.vue

@@ -95,8 +95,12 @@ detail?.reviewResult?.results?.map(v => {
 
 onMounted(() => {
   const target = detail.reviewResult.thumbnailMeta;
-  const r_width = left.value.$el.offsetWidth - 52;
-  let h = (target.naturalHeight / target.naturalWidth) * r_width;
+  let r_width = left.value.$el.offsetWidth - 52;
+  let h = (target.heightInPixel / target.widthInPixel) * r_width;
+  if (h > left.value.$el.offsetHeight) {
+    h = left.value.$el.offsetHeight - 52;
+  }
+  console.log('---',target, h, r_width)
   image_data.value = {
     height: h,
     width: r_width