Skip to content

Commit 70ed9ae

Browse files
fix: bind HeightmapGenerator methods for correct context in editHeightmap (#1281)
1 parent 4b341a6 commit 70ed9ae

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

public/modules/ui/heightmap-editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ function editHeightmap(options) {
675675
if (power === 0) return tip("Power should not be zero", false, "error");
676676

677677
const heights = grid.cells.h;
678-
const operation = power > 0 ? HeightmapGenerator.addRange : HeightmapGenerator.addTrough;
678+
const operation = power > 0 ? HeightmapGenerator.addRange.bind(HeightmapGenerator) : HeightmapGenerator.addTrough.bind(HeightmapGenerator);
679679
HeightmapGenerator.setGraph(grid);
680680
operation("1", String(Math.abs(power)), null, null, fromCell, toCell);
681681
const changedHeights = HeightmapGenerator.getHeights();

0 commit comments

Comments
 (0)