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 @@ ...@@ -49,6 +49,8 @@
#include <collectors.h> #include <collectors.h>
#include <pcbnew_id.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 /// 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[] = { const LAYER_WIDGET::ROW PCB_LAYER_WIDGET::s_render_rows[] = {
...@@ -420,8 +422,13 @@ void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled ) ...@@ -420,8 +422,13 @@ void PCB_LAYER_WIDGET::OnRenderEnable( int aId, bool isEnabled )
EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas(); EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();
if( galCanvas ) if( galCanvas )
{ {
KIGFX::VIEW* view = galCanvas->GetView(); if( aId == GRID_VISIBLE )
view->SetLayerVisible( ITEM_GAL_LAYER( aId ), isEnabled ); {
galCanvas->GetGAL()->SetGridVisibility( myframe->IsGridVisible() );
galCanvas->GetView()->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
}
else
galCanvas->GetView()->SetLayerVisible( ITEM_GAL_LAYER( aId ), isEnabled );
} }
if( galCanvas && myframe->IsGalCanvasActive() ) 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