Skip to content

Commit

Permalink
Plumbing to allow drawing on single click
Browse files Browse the repository at this point in the history
  • Loading branch information
Rainer Simon committed Nov 3, 2021
1 parent 477040f commit ea7d66c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
});

var anno = OpenSeadragon.Annotorious(viewer, {
locale: 'auto'
locale: 'auto',
drawOnSingleClick: true
});

anno.setAuthInfo({
Expand Down
3 changes: 2 additions & 1 deletion src/OSDAnnotationLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export class AnnotationLayer extends EventEmitter {
this.formatter = props.config.formatter;

this.disableSelect = props.disableSelect;
this.drawOnSingleClick = props.config.drawOnSingleClick;

this.svg = document.createElementNS(SVG_NAMESPACE, 'svg');

Expand Down Expand Up @@ -179,7 +180,7 @@ export class AnnotationLayer extends EventEmitter {

pressHandler: evt => {
if (!this.tools.current.isDrawing) {
this.tools.current.start(evt.originalEvent);
this.tools.current.start(evt.originalEvent, this.drawOnSingleClick && !this.hoveredShape);
this.scaleTool(this.tools.current);
}
},
Expand Down

0 comments on commit ea7d66c

Please sign in to comment.