Commit 44e1f4fa authored by cdelbegu's avatar cdelbegu Committed by jean-pierre charras

Pcbnew - GAL: fix bug #1296811 (The grid can't be enable/disable via the layer manager)

parent 47b5bdcd
......@@ -49,6 +49,8 @@
#include <collectors.h>
#include <pcbnew_id.h>
#include <gal/graphics_abstraction_layer.h>
/// This is a read only template that is copied and modified before adding to LAYER_WIDGET
const LAYER_WIDGET::ROW PCB_LAYER_WIDGET::s_render_rows[] = {
......@@ -420,8 +422,13 @@ void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();
if( galCanvas )
{
KIGFX::VIEW* view = galCanvas->GetView();
view->SetLayerVisible( ITEM_GAL_LAYER( aId ), isEnabled );
if( aId == GRID_VISIBLE )
{
galCanvas->GetGAL()->SetGridVisibility( myframe->IsGridVisible() );
galCanvas->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
}
else
galCanvas->GetView()->SetLayerVisible( ITEM_GAL_LAYER( aId ), isEnabled );
}
if( galCanvas && myframe->IsGalCanvasActive() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment