Don't allow 45deg rotation to bloat pad numbers/netnames.

Fixes https://gitlab.com/kicad/code/kicad/issues/5064
This commit is contained in:
Jeff Young 2020-08-04 17:53:36 +01:00
parent a5f5a20722
commit 77fd384da5
1 changed files with 13 additions and 0 deletions

View File

@ -705,6 +705,19 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer )
EDA_RECT padBBox = aPad->GetBoundingBox();
VECTOR2D position = padBBox.Centre();
VECTOR2D padsize = VECTOR2D( padBBox.GetSize() );
if( aPad->GetShape() != PAD_SHAPE_CUSTOM )
{
// Don't allow a 45º rotation to bloat a pad's bounding box unnecessarily
double limit = std::min( aPad->GetSize().x, aPad->GetSize().y ) * 1.1;
if( padsize.x > limit && padsize.y > limit )
{
padsize.x = limit;
padsize.y = limit;
}
}
double maxSize = PCB_RENDER_SETTINGS::MAX_FONT_SIZE;
double size = padsize.y;