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.)
This commit is contained in:
Jeff Young 2024-03-21 18:14:29 +00:00
parent 58df9c96f4
commit b285545aee
1 changed files with 3 additions and 0 deletions

View File

@ -622,6 +622,9 @@ void VIEW::SetCenter( const VECTOR2D& aCenter, const std::vector<BOX2D>& 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();