fix: checkbox custom size rendering error #529
This commit is contained in:
@@ -61,11 +61,10 @@ export class CheckboxParticle {
|
|||||||
// 勾选对号
|
// 勾选对号
|
||||||
ctx.beginPath()
|
ctx.beginPath()
|
||||||
ctx.strokeStyle = fontStyle
|
ctx.strokeStyle = fontStyle
|
||||||
ctx.lineWidth = lineWidth * 2
|
ctx.lineWidth = lineWidth * 2 * scale
|
||||||
ctx.moveTo(left + 2 * scale, top + 7 * scale)
|
ctx.moveTo(left + 2 * scale, top + height / 2)
|
||||||
ctx.lineTo(left + 7 * scale, top + 11 * scale)
|
ctx.lineTo(left + width / 2, top + height - 3 * scale)
|
||||||
ctx.moveTo(left + 6.5 * scale, top + 11 * scale)
|
ctx.lineTo(left + width - 2 * scale, top + 3 * scale)
|
||||||
ctx.lineTo(left + 12 * scale, top + 3 * scale)
|
|
||||||
ctx.stroke()
|
ctx.stroke()
|
||||||
} else {
|
} else {
|
||||||
ctx.lineWidth = lineWidth
|
ctx.lineWidth = lineWidth
|
||||||
|
|||||||
@@ -133,13 +133,16 @@ export class ListParticle {
|
|||||||
ctx: CanvasRenderingContext2D,
|
ctx: CanvasRenderingContext2D,
|
||||||
listElementList: IElement[]
|
listElementList: IElement[]
|
||||||
): number {
|
): number {
|
||||||
const { scale } = this.options
|
const { scale, checkbox } = this.options
|
||||||
const startElement = listElementList[0]
|
const startElement = listElementList[0]
|
||||||
// 非递增样式返回固定值
|
// 非递增样式返回固定值
|
||||||
if (
|
if (
|
||||||
startElement.listStyle &&
|
startElement.listStyle &&
|
||||||
startElement.listStyle !== ListStyle.DECIMAL
|
startElement.listStyle !== ListStyle.DECIMAL
|
||||||
) {
|
) {
|
||||||
|
if (startElement.listStyle === ListStyle.CHECKBOX) {
|
||||||
|
return (checkbox.width + this.LIST_GAP) * scale
|
||||||
|
}
|
||||||
return this.UN_COUNT_STYLE_WIDTH * scale
|
return this.UN_COUNT_STYLE_WIDTH * scale
|
||||||
}
|
}
|
||||||
// 计算列表数量
|
// 计算列表数量
|
||||||
|
|||||||
Reference in New Issue
Block a user