From f7bce264bbbc8fa9e58eedb756103ab19a9e6c7e Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Thu, 21 Mar 2024 18:14:29 +0000 Subject: [PATCH] Don't take too long worrying about very small exposed areas. (And in particular, don't take forever if the min / 10 results in step being 0.) (cherry picked from commit b285545aeeeb53fabee8b25cdd236f9374a930a8) --- common/view/view.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/common/view/view.cpp b/common/view/view.cpp index dddc6ae5a7..cecb564658 100644 --- a/common/view/view.cpp +++ b/common/view/view.cpp @@ -622,6 +622,9 @@ void VIEW::SetCenter( const VECTOR2D& aCenter, const std::vector& obscuri BOX2I bbox = unobscuredPoly.BBox(); int step = std::min( bbox.GetWidth(), bbox.GetHeight() ) / 10; + if( step < 20 ) + step = 20; + while( !unobscuredPoly.IsEmpty() ) { unobscuredCenter = unobscuredPoly.BBox().Centre();