Formatting.

This commit is contained in:
Jeff Young 2020-12-15 17:11:14 +00:00
parent 4cc43b3bd3
commit 92db1d35e1
3 changed files with 24 additions and 21 deletions

View File

@ -503,8 +503,8 @@ void LIB_PART::Print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, int aM
} }
void LIB_PART::Plot( PLOTTER* aPlotter, int aUnit, int aConvert, void LIB_PART::Plot( PLOTTER* aPlotter, int aUnit, int aConvert, const wxPoint& aOffset,
const wxPoint& aOffset, const TRANSFORM& aTransform ) const TRANSFORM& aTransform )
{ {
wxASSERT( aPlotter != NULL ); wxASSERT( aPlotter != NULL );

View File

@ -167,10 +167,10 @@ void LIB_RECTANGLE::print( RENDER_SETTINGS* aSettings, const wxPoint& aOffset, v
if( forceNoFill && m_Fill != FILL_TYPE::NO_FILL && penWidth == 0 ) if( forceNoFill && m_Fill != FILL_TYPE::NO_FILL && penWidth == 0 )
return; return;
wxDC* DC = aSettings->GetPrintDC(); wxDC* DC = aSettings->GetPrintDC();
COLOR4D color = aSettings->GetLayerColor( LAYER_DEVICE ); COLOR4D color = aSettings->GetLayerColor( LAYER_DEVICE );
wxPoint pt1 = aTransform.TransformCoordinate( m_Pos ) + aOffset; wxPoint pt1 = aTransform.TransformCoordinate( m_Pos ) + aOffset;
wxPoint pt2 = aTransform.TransformCoordinate( m_End ) + aOffset; wxPoint pt2 = aTransform.TransformCoordinate( m_End ) + aOffset;
if( forceNoFill || m_Fill == FILL_TYPE::NO_FILL ) if( forceNoFill || m_Fill == FILL_TYPE::NO_FILL )
{ {

View File

@ -713,10 +713,10 @@ void SCH_SCREEN::UpdateLocalLibSymbolLinks()
{ {
std::vector<SCH_COMPONENT*> symbols; std::vector<SCH_COMPONENT*> symbols;
for( auto item : Items().OfType( SCH_COMPONENT_T ) ) for( SCH_ITEM* item : Items().OfType( SCH_COMPONENT_T ) )
symbols.push_back( static_cast<SCH_COMPONENT*>( item ) ); symbols.push_back( static_cast<SCH_COMPONENT*>( item ) );
for( auto symbol : symbols ) for( SCH_COMPONENT* symbol : symbols )
{ {
// Changing the symbol may adjust the bbox of the symbol; remove and reinsert it afterwards. // Changing the symbol may adjust the bbox of the symbol; remove and reinsert it afterwards.
m_rtree.remove( symbol ); m_rtree.remove( symbol );
@ -738,11 +738,11 @@ void SCH_SCREEN::UpdateLocalLibSymbolLinks()
void SCH_SCREEN::Print( RENDER_SETTINGS* aSettings ) void SCH_SCREEN::Print( RENDER_SETTINGS* aSettings )
{ {
// Ensure links are up to date, even if a library was reloaded for some reason: // Ensure links are up to date, even if a library was reloaded for some reason:
std::vector< SCH_ITEM* > junctions; std::vector<SCH_ITEM*> junctions;
std::vector<SCH_ITEM*> bitmaps; std::vector<SCH_ITEM*> bitmaps;
std::vector<SCH_ITEM*> other; std::vector<SCH_ITEM*> other;
for( auto item : Items() ) for( SCH_ITEM* item : Items() )
{ {
if( item->IsMoving() || item->IsResized() ) if( item->IsMoving() || item->IsResized() )
continue; continue;
@ -765,13 +765,13 @@ void SCH_SCREEN::Print( RENDER_SETTINGS* aSettings )
return a->Type() > b->Type(); return a->Type() > b->Type();
} ); } );
for( auto item : bitmaps ) for( SCH_ITEM* item : bitmaps )
item->Print( aSettings, wxPoint( 0, 0 ) ); item->Print( aSettings, wxPoint( 0, 0 ) );
for( auto item : other ) for( SCH_ITEM* item : other )
item->Print( aSettings, wxPoint( 0, 0 ) ); item->Print( aSettings, wxPoint( 0, 0 ) );
for( auto item : junctions ) for( SCH_ITEM* item : junctions )
item->Print( aSettings, wxPoint( 0, 0 ) ); item->Print( aSettings, wxPoint( 0, 0 ) );
} }
@ -797,12 +797,14 @@ void SCH_SCREEN::Plot( PLOTTER* aPlotter )
} }
/// Sort to ensure plot-order consistency with screen drawing /// Sort to ensure plot-order consistency with screen drawing
std::sort( other.begin(), other.end(), []( const SCH_ITEM* a, const SCH_ITEM* b ) { std::sort( other.begin(), other.end(),
if( a->Type() == b->Type() ) []( const SCH_ITEM* a, const SCH_ITEM* b )
return a->GetLayer() > b->GetLayer(); {
if( a->Type() == b->Type() )
return a->GetLayer() > b->GetLayer();
return a->Type() > b->Type(); return a->Type() > b->Type();
} ); } );
int defaultPenWidth = aPlotter->RenderSettings()->GetDefaultPenWidth(); int defaultPenWidth = aPlotter->RenderSettings()->GetDefaultPenWidth();
@ -831,7 +833,7 @@ void SCH_SCREEN::Plot( PLOTTER* aPlotter )
void SCH_SCREEN::ClearDrawingState() void SCH_SCREEN::ClearDrawingState()
{ {
for( auto item : Items() ) for( SCH_ITEM* item : Items() )
item->ClearTempFlags(); item->ClearTempFlags();
} }
@ -868,6 +870,7 @@ LIB_PIN* SCH_SCREEN::GetPin( const wxPoint& aPosition, SCH_COMPONENT** aSymbol,
if( candidate->GetPinPhysicalPosition( pin ) == aPosition ) if( candidate->GetPinPhysicalPosition( pin ) == aPosition )
break; break;
} }
if( pin ) if( pin )
break; break;
} }