From 8f112c4a8f719b47a15058dc5c9dfc732acf7e43 Mon Sep 17 00:00:00 2001 From: Manuel Castro Date: Fri, 23 Jul 2021 15:15:12 -0400 Subject: [PATCH] fix: annotation shortcut not properly freed on deletion --- src/neuroglancer/annotation/user_layer.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/neuroglancer/annotation/user_layer.ts b/src/neuroglancer/annotation/user_layer.ts index 2db5affc3f..82f99e6535 100644 --- a/src/neuroglancer/annotation/user_layer.ts +++ b/src/neuroglancer/annotation/user_layer.ts @@ -115,8 +115,11 @@ export class AnnotationUserLayer extends Base { new LayerReference(this.manager.rootLayers.addRef(), isValidLinkedSegmentationLayer)); filterBySegmentation = new TrackableBoolean(false); shortcutHandler = this.registerDisposer(new AnnotationShortcutHandler()); - private keyShortcutModifier = 'shift+'; - private keyShortcuts = ['q', 'w', 'e', 'r', 't', 'a', 's', 'd', 'f', 'g', 'z', 'x', 'c', 'v']; + private keyShortcuts = [ + 'shift+keyq', 'shift+keyw', 'shift+keye', 'shift+keyr', 'shift+keyt', 'shift+keya', + 'shift+keys', 'shift+keyd', 'shift+keyf', 'shift+keyg', 'shift+keyz', 'shift+keyx', + 'shift+keyc', 'shift+keyv' + ]; private tagToShortcut: Map = new Map(); private _numTagsAllowed = this.keyShortcuts.length; @@ -369,8 +372,7 @@ export class AnnotationUserLayer extends Base { addAnnotationTagShortcut(tagId: number) { const {localAnnotations, selectedAnnotation, shortcutHandler: shortcutHandlerViewer} = this; - const shortcutKey = this.keyShortcuts.splice(0, 1)[0]; - const shortcutCode = this.keyShortcutModifier + 'key' + shortcutKey; + const shortcutCode = this.keyShortcuts.splice(0, 1)[0]; this.tagToShortcut.set(tagId, shortcutCode); const addAnnotationTagToAnnotation = () => { const reference = selectedAnnotation.reference;