Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Annotation shortcut #935

Merged
merged 6 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,14 @@ export default {
}
},
convertMeasurement() {
if (!this.hasSelectedLabel) {
this.requireSelectedLabel(false);
} else {
this.annotationSource.addFeature(this.measureFeature);
this.handleNewFeature({feature: this.measureFeature});
this.clearMeasureFeature();
if (this.isMeasuring && !this.cantConvertMeasureFeature) {
if (!this.hasSelectedLabel) {
this.requireSelectedLabel(false);
} else {
this.annotationSource.addFeature(this.measureFeature);
this.handleNewFeature({feature: this.measureFeature});
this.clearMeasureFeature();
}
}
},
clearMeasureFeature() {
Expand Down Expand Up @@ -110,6 +112,7 @@ export default {
measureInteraction.on('drawstart', this.handleMeasureDrawStart);
measureInteraction.on('drawend', this.handleMeasureDrawEnd);
Keyboard.on('Shift+f', this.toggleMeasuring, 0, this.listenerSet);
Keyboard.on('Enter', this.convertMeasurement, 0, this.listenerSet)

// Do not make this reactive.
// See: https://github.com/biigle/annotations/issues/108
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
</control-button>
<control-button icon="icon-linestring" title="Draw a line string 𝗙, hold 𝗦𝗵𝗶𝗳𝘁 for freehand" :active="isDrawingLineString" v-on:click="drawLineString">
<control-button icon="fa-ruler" title="Measure a line string 𝗦𝗵𝗶𝗳𝘁+𝗙" :active="isMeasuring" v-on:click="toggleMeasuring"></control-button>
<control-button icon="fa-check" title="Convert measurement to a line string" :disabled="cantConvertMeasureFeature" v-on:click="convertMeasurement"></control-button>
<control-button icon="fa-check" title="Convert measurement to a line string 𝗘𝗻𝘁𝗲𝗿" :disabled="cantConvertMeasureFeature" v-on:click="convertMeasurement"></control-button>
</control-button>
<control-button icon="icon-polygon" title="Draw a polygon 𝗚, hold 𝗦𝗵𝗶𝗳𝘁 for freehand" :active="isDrawingPolygon" v-on:click="drawPolygon">
<control-button v-cloak icon="fa-paint-brush" title="Draw a polygon using the brush tool 𝗘" :active="isUsingPolygonBrush" v-on:click="togglePolygonBrush"></control-button>
Expand Down
19 changes: 19 additions & 0 deletions resources/views/manual/tutorials/annotations/shortcuts.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,25 @@
</tbody>
</table>

<p>
When the ruler tool is activated:
</p>

<table class="table">
<thead>
<tr>
<th>Key</th>
<th>Function</th>
</tr>
</thead>
<tbody>
<tr>
<td><kbd>Enter</kbd></td>
<td>Convert measurement to a line string annotation</td>
</tr>
</tbody>
</table>

<p>
When Volare (cycle through annotations) is activated:
</p>
Expand Down