From a7cb9e75b9be1f1523f81a8ecab9a2cf99aaf7aa Mon Sep 17 00:00:00 2001 From: CanadaHonk Date: Tue, 7 Nov 2023 22:47:37 +0000 Subject: [PATCH] layout: fix error in lengthAbs when resolveValue gives number fixes #7 --- engine/layout.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/engine/layout.js b/engine/layout.js index ef19ee2..3b4bc59 100644 --- a/engine/layout.js +++ b/engine/layout.js @@ -499,7 +499,8 @@ export class LayoutNode extends Node { // technically but uhm yeah lengthAbs(i, property, parent = this.parent) { - const x = this.resolveValue(i, property, parent); + const x = this.resolveValue(i ?? '', property, parent); + if (typeof x === 'number') return x; if (property === 'font-size') { // :/