Skip to content

Commit

Permalink
layout: fix error in lengthAbs when resolveValue gives number
Browse files Browse the repository at this point in the history
fixes #7
  • Loading branch information
CanadaHonk committed Nov 7, 2023
1 parent 6c3b0eb commit a7cb9e7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion engine/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,8 @@ export class LayoutNode extends Node {

// technically <length-percentage> 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') {
// :/
Expand Down

0 comments on commit a7cb9e7

Please sign in to comment.