Merge pull request #4105 from jeanp413/jp/fix-vs-160070

Fixes https://github.com/microsoft/vscode/issues/160070
This commit is contained in:
Daniel Imms
2022-09-07 10:00:43 -07:00
committed by GitHub
+6 -1
View File
@@ -31,6 +31,11 @@ export function observeDevicePixelDimensions(element: HTMLElement, callback: (de
callback(width, height);
}
});
observer.observe(element, { box: ['device-pixel-content-box'] } as any);
try {
observer.observe(element, { box: ['device-pixel-content-box'] } as any);
} catch {
observer.disconnect();
observer = undefined;
}
return toDisposable(() => observer?.disconnect());
}