Add DRC items when reloading board view (Fixes lp:1542420)

This commit is contained in:
Jon Evans 2017-11-28 21:57:28 -05:00 committed by jean-pierre charras
parent f3ea34e3c6
commit 8f79f0a66d
2 changed files with 12 additions and 11 deletions

View File

@ -35,6 +35,7 @@
#include <class_board.h>
#include <class_module.h>
#include <class_track.h>
#include <class_marker_pcb.h>
#include <wxBasePcbFrame.h>
#include <gal/graphics_abstraction_layer.h>
@ -159,6 +160,12 @@ void PCB_DRAW_PANEL_GAL::DisplayBoard( const BOARD* aBoard )
for( SEGZONE* zone = aBoard->m_Zone; zone; zone = zone->Next() )
m_view->Add( zone );
// DRC markers
for( int marker_idx = 0; marker_idx < aBoard->GetMARKERCount(); ++marker_idx )
{
m_view->Add( aBoard->GetMARKER( marker_idx ) );
}
// Ratsnest
m_ratsnest.reset( new KIGFX::RATSNEST_VIEWITEM( aBoard->GetConnectivity() ) );
m_view->Add( m_ratsnest.get() );

View File

@ -1249,21 +1249,15 @@ void PCB_PAINTER::draw( const MARKER_PCB* aMarker )
VECTOR2D( 9 * scale, 9 * scale ),
VECTOR2D( 8 * scale, 13 * scale ),
VECTOR2D( 3 * scale, 4 * scale ),
VECTOR2D( 1 * scale, 8 * scale )
VECTOR2D( 1 * scale, 8 * scale ),
VECTOR2D( 0 * scale, 0 * scale )
};
auto strokeColor = m_pcbSettings.GetColor( aMarker, LAYER_DRC );
m_gal->Save();
m_gal->Translate( aMarker->GetPosition() );
if( aMarker->IsSelected() )
{
m_gal->SetFillColor( COLOR4D( 1.0, 0.5, 0.5, 1.0 ) );
}
else
{
m_gal->SetFillColor( COLOR4D( 1.0, 0.0, 0.0, 1.0 ) );
}
m_gal->SetFillColor( strokeColor );
m_gal->SetIsFill( true );
m_gal->SetIsStroke( false );
m_gal->DrawPolygon( arrow, sizeof( arrow ) / sizeof( VECTOR2D ) );