Regression fix: editor no longer reset when zooming in OSD

This commit is contained in:
Rainer Simon 2021-08-10 12:23:43 +02:00
parent 26d88f9818
commit 198a66f6ed
1 changed files with 8 additions and 4 deletions

View File

@ -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)