From 66f25b80270d83f931fda60833c19faaaa836db6 Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Sun, 15 Feb 2026 12:25:09 -0500 Subject: [PATCH] fix: warn when zone coordinates extend beyond image dimensions Before limitPoints() silently clamps coordinates, check if any zone point exceeds the monitor's image dimensions and show a warning icon with tooltip in the zones table. Co-Authored-By: Claude Opus 4.6 --- web/skins/classic/views/zones.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/web/skins/classic/views/zones.php b/web/skins/classic/views/zones.php index 5d16cf7be..8c9b0a9d0 100644 --- a/web/skins/classic/views/zones.php +++ b/web/skins/classic/views/zones.php @@ -65,6 +65,14 @@ echo getNavBarHTML(); foreach ( dbFetchAll('SELECT * FROM Zones WHERE MonitorId=? ORDER BY Area DESC', NULL, array($mid)) as $row ) { $row['Points'] = coordsToPoints($row['Coords']); + $row['OutOfBounds'] = false; + foreach ($row['Points'] as $point) { + if ($point['x'] < $minX || $point['x'] > $maxX || $point['y'] < $minY || $point['y'] > $maxY) { + $row['OutOfBounds'] = true; + break; + } + } + limitPoints($row['Points'], $minX, $minY, $maxX, $maxY); $row['Coords'] = pointsToCoords($row['Points']); $row['AreaCoords'] = preg_replace('/\s+/', ',', $row['Coords']); @@ -91,7 +99,11 @@ echo getNavBarHTML(); foreach ($zones as $zone) { ?> - + ViewWidth().'x'.$monitor->ViewHeight().'). Points have been clamped.').'"> '; + } + ?>  / ViewWidth()*$monitor->ViewHeight()) ) ?> disabled="disabled"/>