|
|
@ -1310,9 +1310,15 @@ const BOX2I PAD::ViewBBox() const |
|
|
|
VECTOR2I solderPasteMargin = VECTOR2D( GetSolderPasteMargin() ); |
|
|
|
EDA_RECT bbox = GetBoundingBox(); |
|
|
|
|
|
|
|
// get the biggest possible clearance
|
|
|
|
int clearance = 0; |
|
|
|
|
|
|
|
for( PCB_LAYER_ID layer : GetLayerSet().Seq() ) |
|
|
|
clearance = std::max( clearance, GetOwnClearance( layer ) ); |
|
|
|
|
|
|
|
// Look for the biggest possible bounding box
|
|
|
|
int xMargin = std::max( solderMaskMargin, solderPasteMargin.x ); |
|
|
|
int yMargin = std::max( solderMaskMargin, solderPasteMargin.y ); |
|
|
|
int xMargin = std::max( solderMaskMargin, solderPasteMargin.x ) + clearance; |
|
|
|
int yMargin = std::max( solderMaskMargin, solderPasteMargin.y ) + clearance; |
|
|
|
|
|
|
|
return BOX2I( VECTOR2I( bbox.GetOrigin() ) - VECTOR2I( xMargin, yMargin ), |
|
|
|
VECTOR2I( bbox.GetSize() ) + VECTOR2I( 2 * xMargin, 2 * yMargin ) ); |
|
|
|