Merge pull request #202 from Kujiale-Mobile/heidao
fix: 修复textDecoration相关问题
This commit is contained in:
commit
0fb26a323c
@ -518,9 +518,11 @@ export default class Painter {
|
||||
this.ctx.fillText(text, x, y, measuredWith);
|
||||
}
|
||||
if (view.css.textDecoration) {
|
||||
const fontSize = view.css.fontSize.toPx();
|
||||
this.ctx.lineWidth = fontSize / 13;
|
||||
this.ctx.beginPath();
|
||||
this.ctx.moveTo(...this.callbackInfo.textDecoration.moveTo);
|
||||
this.ctx.lineTo(...this.callbackInfo.textDecoration.lineTo);
|
||||
this.ctx.moveTo(...this.movingCache.textDecoration.moveTo);
|
||||
this.ctx.lineTo(...this.movingCache.textDecoration.lineTo);
|
||||
this.ctx.closePath();
|
||||
this.ctx.strokeStyle = view.css.color;
|
||||
this.ctx.stroke();
|
||||
@ -612,6 +614,7 @@ export default class Painter {
|
||||
}
|
||||
const fontSize = view.css.fontSize.toPx();
|
||||
if (view.css.textDecoration) {
|
||||
this.ctx.lineWidth = fontSize / 13;
|
||||
this.ctx.beginPath();
|
||||
if (/\bunderline\b/.test(view.css.textDecoration)) {
|
||||
this.ctx.moveTo(lineX, y);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user