From 360c3a268bd60c5a711dd27cdf3ec491fd653a9d Mon Sep 17 00:00:00 2001 From: CrossPr0duct Date: Sat, 1 Mar 2025 21:25:27 -0500 Subject: [PATCH] Fixing the flow feels more natural, swaps to shape selection or image selection when that is added, except for render copy. --- frontend/realtime/src/KonvaApp/Engine.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/frontend/realtime/src/KonvaApp/Engine.ts b/frontend/realtime/src/KonvaApp/Engine.ts index 200ee628fa..d91b7edc02 100644 --- a/frontend/realtime/src/KonvaApp/Engine.ts +++ b/frontend/realtime/src/KonvaApp/Engine.ts @@ -201,6 +201,9 @@ export class Engine { uiAccess.toolbarMain.changeButtonState(ToolbarMainButtonNames.SELECT, { active: false, }); + uiAccess.toolbarMain.changeButtonState(ToolbarMainButtonNames.PAINT, { + active: true, + }); this.matteBox.disable(); return; } @@ -214,6 +217,9 @@ export class Engine { uiAccess.toolbarMain.changeButtonState(ToolbarMainButtonNames.SELECT, { active: true, }); + uiAccess.toolbarMain.changeButtonState(ToolbarMainButtonNames.PAINT, { + active: false, + }); this.matteBox.disable(); document.body.style.cursor = "default"; return; @@ -570,6 +576,7 @@ export class Engine { } public addShape(type: ShapeType, size: number, color?: string) { + const shapeNode = new ShapeNode({ canvasPosition: this.realTimeDrawEngine.captureCanvas.position(), canvasSize: this.realTimeDrawEngine.captureCanvas.size(), @@ -580,6 +587,7 @@ export class Engine { selectionManagerRef: this.selectionManager, loaded: async () => { await this.realTimeDrawEngine.render(); + this.setAppMode(AppModes.SELECT); }, }); @@ -596,6 +604,7 @@ export class Engine { selectionManagerRef: this.selectionManager, loaded: async () => { this.realTimeDrawEngine.render(); + this.setAppMode(AppModes.SELECT); }, }); this.commandManager.createNode(copyNode); @@ -609,6 +618,7 @@ export class Engine { selectionManagerRef: this.selectionManager, loaded: async () => { await this.realTimeDrawEngine.render(); + this.setAppMode(AppModes.SELECT); }, });