Make batch preview menu draggable and position-aware

Added draggable functionality to the batch preview menu, allowing users to reposition it within the canvas using world coordinates. The menu's position now updates with viewport changes, and its initial placement is centered below the output area. Also refactored logic to show the menu with new layers instead of adding to an existing batch.
This commit is contained in:
Dariusz L
2025-07-03 03:40:43 +02:00
parent c4af745b2a
commit f8eb91c4ad
3 changed files with 69 additions and 21 deletions

View File

@@ -493,8 +493,8 @@ export class Canvas {
log.info('Auto-refresh triggered, importing latest images.');
const newLayers = await this.canvasIO.importLatestImages(lastExecutionStartTime);
if (newLayers && newLayers.length > 0) {
this.batchPreviewManager.addLayers(newLayers);
if (newLayers && newLayers.length > 1) {
this.batchPreviewManager.show(newLayers);
}
}
};