Merge pull request #4658 from IgorA100/patch-998471

Fix: Don't assign "resize" listener when using Observer (zone.js)
This commit is contained in:
Isaac Connor
2026-02-28 09:48:13 -05:00
committed by GitHub

View File

@@ -716,9 +716,11 @@ function initPage() {
imageFeed.appendChild(zoneSVG);
}
var ro = new ResizeObserver(drawZonePoints);
ro.observe(imageFeed);
window.addEventListener("resize", drawZonePoints, {passive: true});
if (imageFeed) {
(new ResizeObserver(drawZonePoints)).observe(imageFeed);
} else {
window.addEventListener("resize", drawZonePoints, {passive: true});
}
drawZonePoints();
// Manage the BACK button
@@ -745,7 +747,6 @@ function panZoomOut(el) {
zmPanZoom.zoomOut(el);
}
function Polygon_calcArea(coords) {
var n_coords = coords.length;
var float_area = 0.0;