Eeschema: Plot in same order as drawing

This ensures the junctions are on top and the bitmaps are on bottom
This commit is contained in:
Seth Hillbrand 2019-06-16 13:27:11 -07:00
parent b075886b19
commit ddbc25077c
1 changed files with 36 additions and 1 deletions

View File

@ -547,10 +547,45 @@ void SCH_SCREEN::Draw( EDA_DRAW_PANEL* aCanvas, wxDC* aDC, GR_DRAWMODE aDrawMode
void SCH_SCREEN::Plot( PLOTTER* aPlotter ) void SCH_SCREEN::Plot( PLOTTER* aPlotter )
{ {
// Ensure links are up to date, even if a library was reloaded for some reason:
std::vector< SCH_ITEM* > junctions;
std::vector< SCH_ITEM* > bitmaps;
std::vector< SCH_ITEM* > other;
// 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:
UpdateSymbolLinks(); UpdateSymbolLinks();
for( SCH_ITEM* item = m_drawList.begin(); item; item = item->Next() ) for( SCH_ITEM* item = m_drawList.begin(); item; item = item->Next() )
{
if( item->IsMoving() || item->IsResized() )
continue;
if( item->Type() == SCH_JUNCTION_T )
junctions.push_back( item );
else if( item->Type() == SCH_BITMAP_T )
bitmaps.push_back( item );
else
// uncomment line below when there is a virtual EDA_ITEM::GetBoundingBox()
// if( panel->GetClipBox().Intersects( item->GetBoundingBox() ) )
other.push_back( item );
}
// Bitmaps are drawn first to ensure they are in the background
// This is particularly important for the wxPostscriptDC (used in *nix printers) as
// the bitmap PS command clears the screen
for( auto item : bitmaps )
{
aPlotter->SetCurrentLineWidth( item->GetPenSize() );
item->Plot( aPlotter );
}
for( auto item : other )
{
aPlotter->SetCurrentLineWidth( item->GetPenSize() );
item->Plot( aPlotter );
}
for( auto item : junctions )
{ {
aPlotter->SetCurrentLineWidth( item->GetPenSize() ); aPlotter->SetCurrentLineWidth( item->GetPenSize() );
item->Plot( aPlotter ); item->Plot( aPlotter );