Skip to content

Commit 06d14bc

Browse files
TracyGardnerTracyGardner
authored andcommitted
Prevent unnecessary ground mesh recreation when switching tabs
Add logic to ignore BLOCK_MOVE events for scene blocks if no input has changed, preventing the default ground mesh from being recreated when switching between editor tabs. Replit-Commit-Author: Agent Replit-Commit-Session-Id: e0dc7adb-ccb6-4ae2-a1ba-b39688edbccb Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: ff9228da-c115-4989-b4ac-6e7d25a2c470
1 parent bb4509b commit 06d14bc

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ui/blockmesh.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1103,6 +1103,11 @@ export function updateMeshFromBlock(mesh, block, changeEvent) {
11031103
block.type === "create_ground" ||
11041104
block.type === "create_map"
11051105
) {
1106+
if (changeEvent.type === Blockly.Events.BLOCK_MOVE) {
1107+
if (flock.meshDebug)
1108+
console.log("Ignoring BLOCK_MOVE for scene block with no input change");
1109+
return;
1110+
}
11061111
changed = "COLOR";
11071112
} else {
11081113
if (flock.meshDebug)

0 commit comments

Comments
 (0)