|
@@ -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'
|