Remove CanvasState delegating methods from Canvas

Removed delegating methods to CanvasState from Canvas.js and updated all references to use canvas.canvasState directly for state operations (undo, redo, saveStateToDB). Updated CanvasInteractions.js, CanvasIO.js, CanvasLayers.js, and CanvasView.js accordingly. Updated REFACTORING_GUIDE.md to reflect the completion of this refactor.
This commit is contained in:
Dariusz L
2025-06-29 14:11:34 +02:00
parent fd611c5777
commit 1bb4909438
6 changed files with 24 additions and 17 deletions

View File

@@ -469,11 +469,11 @@ export class Canvas {
* - this.canvasInteractions dla obsługi interakcji
* - this.canvasIO dla operacji I/O
* - this.canvasState dla zarządzania stanem
*
* UWAGA: Metody delegujące do CanvasState zostały usunięte.
* Używaj: canvas.canvasState.saveStateToDB(), canvas.canvasState.undo(), etc.
*/
// Delegacje do CanvasState
async saveStateToDB(immediate = false) { return this.canvasState.saveStateToDB(immediate); }
// Delegacje do CanvasLayers
async copySelectedLayers() { return this.canvasLayers.copySelectedLayers(); }
async handlePaste(addMode) { return this.canvasLayers.handlePaste(addMode); }