浏览代码

样式恢复

lifanagju_citu 2 月之前
父节点
当前提交
ec7be4ed6c
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      src/views/recruit/components/jobFairEntShare/index.vue

+ 2 - 3
src/views/recruit/components/jobFairEntShare/index.vue

@@ -99,15 +99,14 @@ const drawCanvas = () => {
         const tagRadius = 8
         const tagSpacing = 22
         let tagY = textY + tagSpacing + 10
-        props.positionList.forEach((tag, index) => {
+        props.positionList.forEach((tag) => {
           let truncatedTag = tag
           while (ctx.measureText(truncatedTag + '...').width > maxTextWidth - 2 * tagPaddingLeftRight && truncatedTag.length > 0) {
             truncatedTag = truncatedTag.slice(0, -1)
           }
           if (truncatedTag !== tag) truncatedTag += '...'
 
-          // bug:第一个职位标签多出长度,需-64
-          const tagWidth = ctx.measureText(truncatedTag).width + 2 * tagPaddingLeftRight - (index ? 0 : 64)
+          const tagWidth = ctx.measureText(truncatedTag).width + 2 * tagPaddingLeftRight
           const tagX = x + (secondImgWidth - tagWidth) / 2
 
           ctx.fillStyle = '#00B760'