diff --git a/packages/core/src/tools/ellipse-tool.ts b/packages/core/src/tools/ellipse-tool.ts index 4bd597fb..db7d8d81 100644 --- a/packages/core/src/tools/ellipse-tool.ts +++ b/packages/core/src/tools/ellipse-tool.ts @@ -52,8 +52,7 @@ export const ellipseTool = (): Tool => { if (!ellipse) { return; } - app.select(ellipse); - app.setTool(selectTool()); + app.setTool(selectTool(ellipse)); }, }; }; diff --git a/packages/core/src/tools/line-tool.ts b/packages/core/src/tools/line-tool.ts index 04456b48..3436700d 100644 --- a/packages/core/src/tools/line-tool.ts +++ b/packages/core/src/tools/line-tool.ts @@ -47,8 +47,7 @@ export const lineTool = (): Tool => { if (!line) { return; } - app.select(line); - app.setTool(selectTool()); + app.setTool(selectTool(line)); }, }; }; diff --git a/packages/core/src/tools/rect-tool.ts b/packages/core/src/tools/rect-tool.ts index 23bbd411..dfe627d3 100644 --- a/packages/core/src/tools/rect-tool.ts +++ b/packages/core/src/tools/rect-tool.ts @@ -43,8 +43,7 @@ export const rectTool = (): Tool => { if (!rectangle) { return; } - app.select(rectangle); - app.setTool(selectTool()); + app.setTool(selectTool(rectangle)); }, }; }; diff --git a/packages/core/src/tools/select-tool.ts b/packages/core/src/tools/select-tool.ts index 1087b790..ce6226d6 100644 --- a/packages/core/src/tools/select-tool.ts +++ b/packages/core/src/tools/select-tool.ts @@ -1,9 +1,11 @@ -import { Tool } from '../types'; +import { ChildType, Tool } from '../types'; -export const selectTool = (): Tool => { +export const selectTool = (...shapes: ChildType[]): Tool => { return { name: 'selectTool', - onActive() {}, + onActive(app) { + app.select(...shapes); + }, onInactive() {}, onMouseDown() {}, };