Skip to content

Commit 9b8c30b

Browse files
committed
fix(tools): show hover labels while placing annotation tools
1 parent 820ad2d commit 9b8c30b

1 file changed

Lines changed: 11 additions & 10 deletions

File tree

src/composables/annotationTool.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -191,20 +191,21 @@ export const useHover = (
191191

192192
watch(synchronousOverlayInfo, resetOverlay);
193193

194-
const overlayInfo = computed(() =>
195-
showOverlay.value
196-
? synchronousOverlayInfo.value
197-
: ({ visible: false } as Info)
198-
);
199-
200194
const toolStore = useToolStore();
201-
const noInfoWithoutSelect = computed(() => {
202-
if (toolStore.currentTool !== Tools.Select)
195+
const TOOLS_WITH_HOVER = [
196+
Tools.Select,
197+
Tools.Ruler,
198+
Tools.Rectangle,
199+
Tools.Polygon,
200+
];
201+
const overlayInfo = computed(() => {
202+
if (!showOverlay.value) return { visible: false } as Info;
203+
if (!TOOLS_WITH_HOVER.includes(toolStore.currentTool))
203204
return { visible: false } as Info;
204-
return overlayInfo.value;
205+
return synchronousOverlayInfo.value;
205206
});
206207

207-
return { overlayInfo: noInfoWithoutSelect, onHover };
208+
return { overlayInfo, onHover };
208209
};
209210

210211
export const usePlacingAnnotationTool = (

0 commit comments

Comments
 (0)