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 { selectionBounds } = this.state;
const nextBounds = bounds(next.selectedElement); const nextBounds = bounds(next.selectedElement);
if (this.props.annotation?.id !== next.annotation.id) {
this.setState({ this.setState({
currentAnnotation: next.annotation, currentAnnotation: next.annotation,
selectionBounds: nextBounds selectionBounds: nextBounds
}); });
} else {
this.setState({ selectionBounds: nextBounds });
}
if (this.props.modifiedTarget != next.modifiedTarget) { if (this.props.modifiedTarget != next.modifiedTarget) {
// Update in case target was changed (move, resize) // Update in case target was changed (move, resize)