diff --git a/pcbnew/pcb_layer_widget.cpp b/pcbnew/pcb_layer_widget.cpp index ffcdd796d0..fee62612c3 100644 --- a/pcbnew/pcb_layer_widget.cpp +++ b/pcbnew/pcb_layer_widget.cpp @@ -726,7 +726,7 @@ void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled ) galCanvas->GetGAL()->SetGridVisibility( myframe->IsGridVisible() ); galCanvas->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); } - else if ( aId == LAYER_RATSNEST ) + else if( aId == LAYER_RATSNEST ) { // don't touch the layers. ratsnest is enabled on per-item basis. galCanvas->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); diff --git a/pcbnew/tool_pcb_editor.cpp b/pcbnew/tool_pcb_editor.cpp index 2149aa6bb8..be222bbeca 100644 --- a/pcbnew/tool_pcb_editor.cpp +++ b/pcbnew/tool_pcb_editor.cpp @@ -44,6 +44,7 @@ #include #include #include +#include #include #include @@ -770,6 +771,14 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event ) OnModify(); Compile_Ratsnest( NULL, true ); + if( IsGalCanvasActive() ) + { + // keep the ratsnest layer enabled in view, so it shows up when an item is dragged + auto view = GetGalCanvas()->GetView(); + view->MarkTargetDirty( KIGFX::TARGET_NONCACHED ); + view->SetLayerVisible( LAYER_RATSNEST, true ); + } + m_canvas->Refresh(); break;