diff --git a/src/components/tools/polygon/PlacingPolygonWidget2D.vue b/src/components/tools/polygon/PlacingPolygonWidget2D.vue new file mode 100644 index 000000000..60b419442 --- /dev/null +++ b/src/components/tools/polygon/PlacingPolygonWidget2D.vue @@ -0,0 +1,152 @@ + + + diff --git a/src/components/tools/polygon/PolygonSVG2D.vue b/src/components/tools/polygon/PolygonSVG2D.vue index bcc5e6d82..4d5ffc87d 100644 --- a/src/components/tools/polygon/PolygonSVG2D.vue +++ b/src/components/tools/polygon/PolygonSVG2D.vue @@ -37,6 +37,7 @@ import { watch, inject, } from 'vue'; +import { Maybe } from '@/src/types'; const POINT_RADIUS = 10; const FINISHABLE_POINT_RADIUS = 16; @@ -53,7 +54,7 @@ export default defineComponent({ required: true, }, movePoint: { - type: Array as unknown as PropType, + type: Array as unknown as PropType>, }, placing: { type: Boolean, diff --git a/src/components/tools/polygon/PolygonTool.vue b/src/components/tools/polygon/PolygonTool.vue index 7284e495e..3a241fd37 100644 --- a/src/components/tools/polygon/PolygonTool.vue +++ b/src/components/tools/polygon/PolygonTool.vue @@ -5,12 +5,19 @@ v-for="tool in tools" :key="tool.id" :tool-id="tool.id" - :is-placing="tool.id === placingToolID" :current-slice="currentSlice" :view-id="viewId" :view-direction="viewDirection" :widget-manager="widgetManager" @contextmenu="openContextMenu(tool.id, $event)" + /> + @@ -19,35 +26,25 @@ + + diff --git a/src/components/tools/rectangle/RectangleSVG2D.vue b/src/components/tools/rectangle/RectangleSVG2D.vue index f7e3dddab..7e1d00e1e 100644 --- a/src/components/tools/rectangle/RectangleSVG2D.vue +++ b/src/components/tools/rectangle/RectangleSVG2D.vue @@ -49,6 +49,7 @@ import { watch, inject, } from 'vue'; +import { Maybe } from '@/src/types'; type SVGPoint = { x: number; @@ -57,8 +58,8 @@ type SVGPoint = { export default defineComponent({ props: { - point1: Array as PropType>, - point2: Array as PropType>, + point1: Array as PropType>>, + point2: Array as PropType>>, color: String, fillColor: String, viewId: { diff --git a/src/components/tools/rectangle/RectangleTool.vue b/src/components/tools/rectangle/RectangleTool.vue index 051e14de2..838db4783 100644 --- a/src/components/tools/rectangle/RectangleTool.vue +++ b/src/components/tools/rectangle/RectangleTool.vue @@ -5,12 +5,20 @@ v-for="tool in tools" :key="tool.id" :tool-id="tool.id" - :is-placing="tool.id === placingToolID" :current-slice="currentSlice" :view-id="viewId" :view-direction="viewDirection" :widget-manager="widgetManager" @contextmenu="openContextMenu(tool.id, $event)" + /> + @@ -19,35 +27,25 @@ + + diff --git a/src/components/tools/ruler/RulerSVG2D.vue b/src/components/tools/ruler/RulerSVG2D.vue index a2bea6bff..b12bd30b9 100644 --- a/src/components/tools/ruler/RulerSVG2D.vue +++ b/src/components/tools/ruler/RulerSVG2D.vue @@ -65,6 +65,7 @@ import { watch, inject, } from 'vue'; +import { Maybe } from '@/src/types'; type SVGPoint = { x: number; @@ -73,8 +74,8 @@ type SVGPoint = { export default defineComponent({ props: { - point1: Array as PropType>, - point2: Array as PropType>, + point1: Array as PropType>>, + point2: Array as PropType>>, color: String, length: Number, viewId: { diff --git a/src/components/tools/ruler/RulerTool.vue b/src/components/tools/ruler/RulerTool.vue index e3359dd9c..b3d1e8332 100644 --- a/src/components/tools/ruler/RulerTool.vue +++ b/src/components/tools/ruler/RulerTool.vue @@ -5,12 +5,19 @@ v-for="ruler in rulers" :key="ruler.id" :ruler-id="ruler.id" - :is-placing="ruler.id === placingRulerID" :current-slice="currentSlice" :view-id="viewId" :view-direction="viewDirection" :widget-manager="widgetManager" @contextmenu="openContextMenu(ruler.id, $event)" + /> + @@ -19,32 +26,24 @@