Tighten up schematic label bounding boxes

Margins were being added in more places than necessary

Fixes https://gitlab.com/kicad/code/kicad/-/issues/7689
This commit is contained in:
Jon Evans
2021-02-24 17:15:35 -05:00
parent d384316335
commit 92cc88f87c
4 changed files with 31 additions and 11 deletions
+15
View File
@@ -193,6 +193,21 @@ bool SCH_PAINTER::Draw( const VIEW_ITEM *aItem, int aLayer )
#endif
if( ADVANCED_CFG::GetCfg().m_DrawBoundingBoxes )
{
BOX2I box = item->GetBoundingBox();
if( item->Type() == SCH_COMPONENT_T )
box = static_cast<const SCH_COMPONENT*>( item )->GetBodyBoundingBox();
m_gal->SetIsFill( false );
m_gal->SetIsStroke( true );
m_gal->SetStrokeColor( item->IsSelected() ? COLOR4D( 1.0, 0.2, 0.2, 1 ) :
COLOR4D( 0.2, 0.2, 0.2, 1 ) );
m_gal->SetLineWidth( Mils2iu( 3 ) );
m_gal->DrawRectangle( box.GetOrigin(), box.GetEnd() );
}
switch( item->Type() )
{
HANDLE_ITEM( LIB_PART_T, LIB_PART );