From 3245da2f157d494934fbd044903811635a513b1c Mon Sep 17 00:00:00 2001 From: Dan Hansen Date: Thu, 17 Feb 2022 16:14:01 -0800 Subject: [PATCH] Correct dereferencing of `createFontStyle` return value --- src/render/canvas/canvas-renderer.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/render/canvas/canvas-renderer.ts b/src/render/canvas/canvas-renderer.ts index 6efb648..1d82b08 100644 --- a/src/render/canvas/canvas-renderer.ts +++ b/src/render/canvas/canvas-renderer.ts @@ -388,10 +388,10 @@ export class CanvasRenderer extends Renderer { } if (isTextInputElement(container) && container.value.length) { - const [fontFamily, fontSize] = this.createFontStyle(styles); + const [font, fontFamily, fontSize] = this.createFontStyle(styles); const {baseline} = this.fontMetrics.getMetrics(fontFamily, fontSize); - this.ctx.font = fontFamily; + this.ctx.font = font; this.ctx.fillStyle = asString(styles.color); this.ctx.textBaseline = 'alphabetic'; @@ -445,9 +445,9 @@ export class CanvasRenderer extends Renderer { } } } else if (paint.listValue && container.styles.listStyleType !== LIST_STYLE_TYPE.NONE) { - const [fontFamily] = this.createFontStyle(styles); + const [font] = this.createFontStyle(styles); - this.ctx.font = fontFamily; + this.ctx.font = font; this.ctx.fillStyle = asString(styles.color); this.ctx.textBaseline = 'middle';