Skip to content

Commit

Permalink
Merge pull request #306 from wearepal/2024-tweaks
Browse files Browse the repository at this point in the history
Expression appears to treat NaN as 0
  • Loading branch information
paulthatjazz authored Jan 3, 2024
2 parents 99bdd85 + f366381 commit 777816a
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ export class ExpressionComponent extends BaseComponent {

const v = inputs[variables[0]][0] as NumericTileGrid

const out = editorNode.meta.output = outputs['out'] = new NumericTileGrid(v.zoom, v.x, v.y, v.width, v.height, 0)
const out = editorNode.meta.output = outputs['out'] = new NumericTileGrid(v.zoom, v.x, v.y, v.width, v.height)

for (let x = v.x; x < v.x + v.width; ++x) {
for (let y = v.y; y < v.y + v.height; ++y) {
Expand All @@ -140,11 +140,7 @@ export class ExpressionComponent extends BaseComponent {

let r = p.evaluate(expression)


if (!isNaN(r)) {
out.set(x, y, r);
}

out.set(x, y, r);
p.clear();
}
}
Expand Down

0 comments on commit 777816a

Please sign in to comment.