Skip to content

Commit

Permalink
Bugfix: annotations no longer displaced when OSD container width < he…
Browse files Browse the repository at this point in the history
…ight
  • Loading branch information
Rainer Simon committed Feb 21, 2021
1 parent 131fe65 commit 4afcbbd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/OSDAnnotationLayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,9 @@ export default class OSDAnnotationLayer extends EventEmitter {
}

currentScale = () => {
const { x, y } = this.viewer.viewport.getContainerSize();
const containerSize = Math.max(x, y);
const containerWidth = this.viewer.viewport.getContainerSize().x;
const zoom = this.viewer.viewport.getZoom(true);
return zoom * containerSize / this.viewer.world.getContentFactor();
return zoom * containerWidth / this.viewer.world.getContentFactor();
}

deselect = () => {
Expand Down

0 comments on commit 4afcbbd

Please sign in to comment.