Merge pull request #7 from simoleo89/feature/floorplan-realtime-preview-v2

feat(floorplan): add real-time preview support to FloorplanEditor
This commit is contained in:
DuckieTM
2026-03-21 08:46:26 +01:00
committed by GitHub
@@ -25,6 +25,8 @@ export class FloorplanEditor
private _image: HTMLImageElement; private _image: HTMLImageElement;
public onTilemapChange: (() => void) | null = null;
constructor() constructor()
{ {
const width = TILE_SIZE * MAX_NUM_TILE_PER_AXIS + 20; const width = TILE_SIZE * MAX_NUM_TILE_PER_AXIS + 20;
@@ -297,6 +299,8 @@ export class FloorplanEditor
} }
this.renderSquareSelectionPreview(); this.renderSquareSelectionPreview();
if(this.onTilemapChange) this.onTilemapChange();
} }
private renderSquareSelectionPreview(): void private renderSquareSelectionPreview(): void
@@ -473,6 +477,7 @@ export class FloorplanEditor
this._squareSelectStart = null; this._squareSelectStart = null;
this._squareSelectEnd = null; this._squareSelectEnd = null;
this.clearCanvas(); this.clearCanvas();
this.onTilemapChange = null;
} }