Sfoglia il codice sorgente

fix:修改水印文件大小文字大小

ly 9 mesi fa
parent
commit
8c2bef0db4
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 5 1
      src/utils/zTool.js

+ 5 - 1
src/utils/zTool.js

@@ -413,7 +413,11 @@ let zTool = {
 			ctx.drawImage(image, 0, 0);
 			// 添加水印文本
 			let size = Math.ceil(image.width*image.height /100000);
-
+			let proportion = Math.ceil(image.height / image.width)
+			  console.log(proportion)
+			if(proportion>2){
+				size=size*0.5
+			}
 			ctx.font = `${size}px Arial`;
 			ctx.fillStyle = 'rgb(228,233,229)';
 			const watermarkText = name; // 水印文本