Minor code cleanup.

This commit is contained in:
Jeff Young 2020-09-06 13:04:52 +01:00
parent d5fd09249b
commit b28332c5f1
2 changed files with 10 additions and 16 deletions

View File

@ -1332,18 +1332,10 @@ void SCH_PAINTER::draw( SCH_TEXT *aText, int aLayer )
switch( aText->GetLabelSpinStyle() ) switch( aText->GetLabelSpinStyle() )
{ {
case LABEL_SPIN_STYLE::LEFT: case LABEL_SPIN_STYLE::LEFT: text_offset.x += getShadowWidth() / 2; break;
text_offset.x += getShadowWidth() / 2; case LABEL_SPIN_STYLE::UP: text_offset.y += getShadowWidth() / 2; break;
break; case LABEL_SPIN_STYLE::RIGHT: text_offset.x -= getShadowWidth() / 2; break;
case LABEL_SPIN_STYLE::UP: case LABEL_SPIN_STYLE::BOTTOM: text_offset.y -= getShadowWidth() / 2; break;
text_offset.y += getShadowWidth() / 2;
break;
case LABEL_SPIN_STYLE::RIGHT:
text_offset.x -= getShadowWidth() / 2;
break;
case LABEL_SPIN_STYLE::BOTTOM:
text_offset.y -= getShadowWidth() / 2;
break;
} }
} }
@ -1353,9 +1345,11 @@ void SCH_PAINTER::draw( SCH_TEXT *aText, int aLayer )
} }
if( aText->IsDangling() ) if( aText->IsDangling() )
{
drawDanglingSymbol( aText->GetTextPos(), Mils2iu( DANGLING_SYMBOL_SIZE / 2 ), drawDanglingSymbol( aText->GetTextPos(), Mils2iu( DANGLING_SYMBOL_SIZE / 2 ),
drawingShadows ); drawingShadows );
} }
}
static void orientPart( LIB_PART* part, int orientation ) static void orientPart( LIB_PART* part, int orientation )

View File

@ -612,15 +612,15 @@ int SCH_SHEET::ComponentCount() const
if( m_screen ) if( m_screen )
{ {
for( auto aItem : m_screen->Items().OfType( SCH_COMPONENT_T ) ) for( SCH_ITEM* aItem : m_screen->Items().OfType( SCH_COMPONENT_T ) )
{ {
SCH_COMPONENT* Cmp = (SCH_COMPONENT*) aItem; SCH_COMPONENT* comp = (SCH_COMPONENT*) aItem;
if( Cmp->GetField( VALUE )->GetText().GetChar( 0 ) != '#' ) if( comp->GetField( VALUE )->GetText().GetChar( 0 ) != '#' )
n++; n++;
} }
for( auto aItem : m_screen->Items().OfType( SCH_SHEET_T ) ) for( SCH_ITEM* aItem : m_screen->Items().OfType( SCH_SHEET_T ) )
n += static_cast<const SCH_SHEET*>( aItem )->ComponentCount(); n += static_cast<const SCH_SHEET*>( aItem )->ComponentCount();
} }