Explorar el Código

水印样式调整

cfort hace 1 año
padre
commit
c8de00003a

+ 6 - 6
src/layout/header-aside/components/header-message/watermark/watermark-cont.js

@@ -8,23 +8,23 @@ const setWatermark = (str = null, str1 = null) => { // 传入多个str 或者传
     }
 
     const can = document.createElement('canvas')
-    can.width = 430
+    can.width = 420
     can.height = 300
 
     const cans = can.getContext('2d')
     cans.rotate(-20 * Math.PI / 180)
-    cans.font = '20px Vedana'
+    cans.font = '22px Vedana'
     cans.fillStyle = '#E7ECF0'
     cans.textAlign = 'left'
     cans.textBaseline = 'Middle'
-    cans.fillText(str, can.width / 3, can.height / 2)
-    cans.fillText(str1, can.width / 3, can.height / 1.7) // 这里渲染多行就可以展示多行,具体效果看上图,这里要调整高度的比例就可以做到换行的效果
+    cans.fillText(str, can.width / 20, can.height / 1.5)
+    cans.fillText(str1, can.width / 20, can.height / 1.3) // 这里渲染多行就可以展示多行,具体效果看上图,这里要调整高度的比例就可以做到换行的效果
 
     const div = document.createElement('div')
     div.id = id
     div.style.pointerEvents = 'none'
-    div.style.top = '150px'
-    div.style.left = '50px'
+    div.style.top = '80px'
+    div.style.left = '150px'
     div.style.position = 'fixed'
     div.style.zIndex = '-100000' // 这里设置层级 设为负值可以在页面下层
     div.style.width = document.documentElement.clientWidth - 100 + 'px'