Changes to selection target now re-render the editor widgets (#34)

This commit is contained in:
Rainer Simon 2021-02-14 11:37:36 +01:00
parent 6d8e0bdb60
commit 432ca90cb4
1 changed files with 5 additions and 0 deletions

View File

@ -38,6 +38,11 @@ const Editor = props => {
}
}, [ bounds(props.selectedElement) ]);
useEffect(() => {
if (currentAnnotation)
setCurrentAnnotation(currentAnnotation.clone({ target: props.modifiedTarget }));
}, [ props.modifiedTarget ])
const initResizeObserver = () => {
if (window?.ResizeObserver) {
const resizeObserver = new ResizeObserver(() => {