GAL: Show ratsnest lines when dragging
GAL is strict regarding which layers are rendered, therefore to show ratsnest lines when an item is dragged - the ratsnest layer must be kept enabled. Ratsnest line visibility is enabled per item and this is the way to show/hide the lines. Fixes: lp:1666473 * https://bugs.launchpad.net/kicad/+bug/1666473
This commit is contained in:
parent
a08c0ac08c
commit
81a5c0e3bf
|
@ -726,7 +726,7 @@ void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
|
||||||
galCanvas->GetGAL()->SetGridVisibility( myframe->IsGridVisible() );
|
galCanvas->GetGAL()->SetGridVisibility( myframe->IsGridVisible() );
|
||||||
galCanvas->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
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.
|
// don't touch the layers. ratsnest is enabled on per-item basis.
|
||||||
galCanvas->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
galCanvas->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
#include <pcbnew_id.h>
|
#include <pcbnew_id.h>
|
||||||
#include <hotkeys.h>
|
#include <hotkeys.h>
|
||||||
#include <pcb_layer_box_selector.h>
|
#include <pcb_layer_box_selector.h>
|
||||||
|
#include <view/view.h>
|
||||||
|
|
||||||
#include <wx/wupdlock.h>
|
#include <wx/wupdlock.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
@ -770,6 +771,14 @@ void PCB_EDIT_FRAME::OnSelectOptionToolbar( wxCommandEvent& event )
|
||||||
OnModify();
|
OnModify();
|
||||||
Compile_Ratsnest( NULL, true );
|
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();
|
m_canvas->Refresh();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue