Enhance paste functionality and clipboard handling

Improves the paste operation in CanvasLayers to prioritize internal clipboard, then ComfyUI Clipspace, and finally the system clipboard, pasting images at the mouse position. Also clears the internal clipboard when the mouse leaves the canvas in CanvasInteractions.
This commit is contained in:
Dariusz L
2025-06-30 00:35:25 +02:00
parent 2eaa3d6620
commit 62a5af4287
2 changed files with 65 additions and 9 deletions

View File

@@ -194,6 +194,12 @@ export class CanvasInteractions {
this.resetInteractionState();
this.canvas.render();
}
// Clear internal clipboard when mouse leaves canvas
if (this.canvas.canvasLayers.internalClipboard.length > 0) {
this.canvas.canvasLayers.internalClipboard = [];
log.info("Internal clipboard cleared - mouse left canvas");
}
}
handleMouseEnter(e) {