Skip to content

Commit

Permalink
Additional Annotation Completion Key (Mac support)
Browse files Browse the repository at this point in the history
  • Loading branch information
ogewan authored Oct 20, 2020
1 parent b4573a2 commit 0167c5f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion WHATS_NEW.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
### 🌴 August 2020 ☀️
### 🎃 October 2020 🍂
## Shortcut to reload mesh
`Ctrl + Shift + LeftClick` on any visible segment in 2D/3D to reload its mesh after an edit.
This helps avoid having to refresh Neuroglancer to see the new mesh.

NOTE: You may need to do this more than once because Neuroglancer cannot know if the remeshing process has completed.
## Additional Keybind to Complete Annotation
`Backquote` key (under `ESC`) can be used to complete an annotation.<sup>*</sup>

<sub>****This serves as an alternative control for when double clicking doesn't work.***</sub>
1 change: 1 addition & 0 deletions src/neuroglancer/ui/default_input_event_bindings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export function getDefaultRenderedDataPanelBindings() {
'at:dblclick0': 'select',
'at:control+mousedown0': 'annotate',
'at:control+dblclick0': 'complete-annotation',
'at:backquote': 'complete-annotation-viakey',
'at:mousedown2': 'move-to-mouse-position',
'at:control+mousedown2': 'select-annotation',
'at:alt+mousedown0': 'move-annotation',
Expand Down
9 changes: 6 additions & 3 deletions src/neuroglancer/viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ export class Viewer extends RefCounted implements ViewerState {
}
});

this.bindAction('complete-annotation', () => {
const actionCompleteAnnotation = (shortcut?: boolean) => {
const selectedLayer = this.selectedLayer.layer;
if (selectedLayer === undefined) {
StatusMessage.showTemporaryMessage(
Expand All @@ -775,8 +775,11 @@ export class Viewer extends RefCounted implements ViewerState {
JSON.stringify(selectedLayer.name)}) does not have an active annotation tool.`);
return;
}
(<MultiStepAnnotationTool>userLayer.tool.value).complete(true);
});
(<MultiStepAnnotationTool>userLayer.tool.value).complete(shortcut);
};

this.bindAction('complete-annotation-viakey', () => actionCompleteAnnotation());
this.bindAction('complete-annotation', () => actionCompleteAnnotation(true));

this.bindAction('toggle-axis-lines', () => this.showAxisLines.toggle());
this.bindAction('toggle-scale-bar', () => this.showScaleBar.toggle());
Expand Down

0 comments on commit 0167c5f

Please sign in to comment.