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'