From 452bcd5c011b8419a1d1591223ae523b463eef24 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Wed, 18 Jan 2023 21:15:51 +0200 Subject: [PATCH] cutting tool, line delete tool --- src/components/house-planner/HousePlanner.vue | 16 +++ .../house-planner/PlannerToolbar.vue | 2 +- src/modules/house-planner/canvas.ts | 3 + src/modules/house-planner/tools.ts | 2 + src/modules/house-planner/tools/cut.ts | 121 ++++++++++++++++++ src/modules/house-planner/tools/line.ts | 7 +- 6 files changed, 146 insertions(+), 5 deletions(-) create mode 100644 src/modules/house-planner/tools/cut.ts diff --git a/src/components/house-planner/HousePlanner.vue b/src/components/house-planner/HousePlanner.vue index 075c070..af05762 100644 --- a/src/components/house-planner/HousePlanner.vue +++ b/src/components/house-planner/HousePlanner.vue @@ -59,6 +59,8 @@ import { HomeIcon, ArrowsPointingOutIcon, ArrowDownOnSquareIcon, + ScissorsIcon, + XMarkIcon, } from '@heroicons/vue/24/outline'; import { useSessionStorage } from '@vueuse/core'; import { onMounted, ref, shallowRef } from 'vue'; @@ -139,6 +141,20 @@ const toolbar: ToolbarTool[] = [ }, ], }, + { + title: 'Cut', + icon: ScissorsIcon, + tool: 'cut', + subTool: 'cut', + children: [ + { + title: 'Cut Segment', + icon: XMarkIcon, + tool: 'cut', + subTool: 'remove-segment', + }, + ], + }, ]; const selectTool = (newTool?: string, newSubTool?: string) => { diff --git a/src/components/house-planner/PlannerToolbar.vue b/src/components/house-planner/PlannerToolbar.vue index 8879f43..a0a3f1b 100644 --- a/src/components/house-planner/PlannerToolbar.vue +++ b/src/components/house-planner/PlannerToolbar.vue @@ -1,6 +1,6 @@