fix textStrokeWidth=0

This commit is contained in:
ysk2014 2020-09-03 17:02:37 +08:00
parent 7c57338d2b
commit 4482b33356

View File

@ -235,7 +235,12 @@ export class CanvasRenderer {
});
}
if (styles.textStrokeWidth && styles.textStrokeColor && text.text.trim().length) {
if (
styles.textStrokeWidth &&
styles.textStrokeWidth.number &&
styles.textStrokeColor &&
text.text.trim().length
) {
this.ctx.strokeStyle = asString(styles.textStrokeColor);
this.ctx.lineWidth = getAbsoluteValue(styles.textStrokeWidth, text.bounds.width);
this.ctx.strokeText(text.text, text.bounds.left, text.bounds.top + text.bounds.height);