Skip to content

Commit

Permalink
fix: Shadow blocks replicated in minimap (#1867)
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarades authored Aug 17, 2023
1 parent 8c3f2cb commit 1da85b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/workspace-minimap/src/minimap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,13 @@ export class Minimap {
* @param event The primary workspace event.
*/
private mirror(event: Blockly.Events.Abstract): void {
// TODO: shadow blocks get mirrored too (not supposed to happen)

if (!blockEvents.has(event.type)) {
return; // Filter out events.
}
if (event.type === Blockly.Events.BLOCK_CREATE &&
(event as any).xml.tagName === 'shadow') {
return; // Filter out shadow blocks.
}
// Run the event in the minimap.
const json = event.toJson();
const duplicate = Blockly.Events.fromJson(json, this.minimapWorkspace);
Expand Down

0 comments on commit 1da85b3

Please sign in to comment.