fix:富文本操作绘制顺序

pr675
Hufe921 4 years ago
parent 97f3a2a1a5
commit 1f703336ca

@ -207,12 +207,6 @@ export class Draw {
}
}
positionList.push(positionItem)
this.ctx.fillText(element.value, x, y + curRow.ascent)
// 选区绘制
const { startIndex, endIndex } = this.range.getRange()
if (startIndex < index && index <= endIndex) {
this.range.drawRange(x, y, metrics.width, curRow.height)
}
// 下划线绘制
if (element.underline) {
this.underline.render(x, y + curRow.height, metrics.width)
@ -225,6 +219,13 @@ export class Draw {
if (element.highlight) {
this.highlight.render(element.highlight, x, y, metrics.width, curRow.height)
}
// 文本
this.ctx.fillText(element.value, x, y + curRow.ascent)
// 选区绘制
const { startIndex, endIndex } = this.range.getRange()
if (startIndex < index && index <= endIndex) {
this.range.drawRange(x, y, metrics.width, curRow.height)
}
index++
x += metrics.width
this.ctx.restore()

Loading…
Cancel
Save