feat:优化最小宽度选区

This commit is contained in:
黄云飞
2021-11-27 12:17:54 +08:00
parent c618173473
commit e413213dbb
4 changed files with 8 additions and 2 deletions
+5 -1
View File
@@ -375,7 +375,11 @@ export class Draw {
// 选区绘制
const { startIndex, endIndex } = this.range.getRange()
if (startIndex !== endIndex && startIndex < index && index <= endIndex) {
this.range.render(ctx, x, y, metrics.width, curRow.height)
let width = metrics.width
if (width === 0 && curRow.elementList.length === 1) {
width = this.options.rangeMinWidth
}
this.range.render(ctx, x, y, width, curRow.height)
}
index++
x += metrics.width