From 198a66f6ed056ebcd4fc0a9c79a8635d0347c52c Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Tue, 10 Aug 2021 12:23:43 +0200 Subject: [PATCH] Regression fix: editor no longer reset when zooming in OSD --- src/editor/Editor.jsx | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/editor/Editor.jsx b/src/editor/Editor.jsx index 05886b3..ad6e402 100644 --- a/src/editor/Editor.jsx +++ b/src/editor/Editor.jsx @@ -37,10 +37,14 @@ export default class Editor extends Component { const { selectionBounds } = this.state; const nextBounds = bounds(next.selectedElement); - this.setState({ - currentAnnotation: next.annotation, - selectionBounds: nextBounds - }); + if (this.props.annotation?.id !== next.annotation.id) { + this.setState({ + currentAnnotation: next.annotation, + selectionBounds: nextBounds + }); + } else { + this.setState({ selectionBounds: nextBounds }); + } if (this.props.modifiedTarget != next.modifiedTarget) { // Update in case target was changed (move, resize)