From 8f79f0a66dc0b33a08f05e6bc50cad21d9b11198 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Tue, 28 Nov 2017 21:57:28 -0500 Subject: [PATCH] Add DRC items when reloading board view (Fixes lp:1542420) --- pcbnew/pcb_draw_panel_gal.cpp | 7 +++++++ pcbnew/pcb_painter.cpp | 16 +++++----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/pcbnew/pcb_draw_panel_gal.cpp b/pcbnew/pcb_draw_panel_gal.cpp index 7621a2e7e0..2e89b60c59 100644 --- a/pcbnew/pcb_draw_panel_gal.cpp +++ b/pcbnew/pcb_draw_panel_gal.cpp @@ -35,6 +35,7 @@ #include #include #include +#include #include #include @@ -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() ); diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 1dc4283e43..ec3992824e 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -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 ) );