Merge pull request #564 from smartxworks/fix/mask

fix(mask): fix wrong mask position
This commit is contained in:
yz-yu 2022-08-08 21:59:17 +08:00 committed by GitHub
commit 9e80727540
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -117,8 +117,9 @@ export class EditorMaskManager {
}
private observeContainerResize() {
this.containerResizeObserver = new ResizeObserver(e => {
this.maskContainerRect = e[0].contentRect;
this.containerResizeObserver = new ResizeObserver(() => {
this.maskContainerRect =
this.maskContainerRef.current?.getBoundingClientRect() || null;
});
this.containerResizeObserver.observe(this.maskContainerRef.current!);