From 4afcbbd3ade44a6476e7cb6ea40ccfe646bf9d85 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Sun, 21 Feb 2021 09:31:41 +0100 Subject: [PATCH] Bugfix: annotations no longer displaced when OSD container width < height --- src/OSDAnnotationLayer.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/OSDAnnotationLayer.js b/src/OSDAnnotationLayer.js index c8e0006..34daa76 100644 --- a/src/OSDAnnotationLayer.js +++ b/src/OSDAnnotationLayer.js @@ -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 = () => {