Monitor: Clip zone polygon to image size when dumping
The polygon vertex coordinated of extra_zone are directly parsed from user input. Clip the resulting polygon to the image size so we don't try to draw outside of the image. This is already done for zone polygons stored and loaded from the DB.
This commit is contained in:
parent
29488900a1
commit
09665b139f
|
@ -1481,6 +1481,10 @@ void Monitor::DumpZoneImage(const char *zone_string) {
|
|||
zone_image->Colourise(ZM_COLOUR_RGB24, ZM_SUBPIX_ORDER_RGB);
|
||||
}
|
||||
|
||||
extra_zone = extra_zone.GetClipped(Box({0, 0},
|
||||
{static_cast<int32>(zone_image->Width()),
|
||||
static_cast<int32>(zone_image->Height())}));
|
||||
|
||||
for (const Zone &zone : zones) {
|
||||
if (exclude_id && (!extra_colour || !extra_zone.GetVertices().empty()) && zone.Id() == exclude_id) {
|
||||
continue;
|
||||
|
|
Loading…
Reference in New Issue