Optimize PAD LoD calculation.

This commit is contained in:
Alex Shvartzkop 2024-06-12 23:04:22 +03:00
parent 52daf14c78
commit f0e9f9f15a
1 changed files with 9 additions and 2 deletions

View File

@ -1620,8 +1620,15 @@ double PAD::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const
return ( double ) pcbIUScale.mmToIU( 5 ) / divisor;
}
// Passed all tests; show.
return 0.0;
VECTOR2L padSize =
GetShape() != PAD_SHAPE::CUSTOM ? VECTOR2L( GetSize() ) : GetBoundingBox().GetSize();
int64_t minSide = std::min( padSize.x, padSize.y );
if( minSide > 0 )
return std::min( (double) pcbIUScale.mmToIU( 0.2 ) / minSide, 3.5 );
else
return 0;
}