Commit 8658d906 authored by Maciej Suminski's avatar Maciej Suminski

Some more spots where the GAL refresh was required.

parent d213a260
...@@ -234,8 +234,12 @@ void EDA_DRAW_FRAME::SkipNextLeftButtonReleaseEvent() ...@@ -234,8 +234,12 @@ void EDA_DRAW_FRAME::SkipNextLeftButtonReleaseEvent()
void EDA_DRAW_FRAME::OnToggleGridState( wxCommandEvent& aEvent ) void EDA_DRAW_FRAME::OnToggleGridState( wxCommandEvent& aEvent )
{ {
SetGridVisibility( !IsGridVisible() ); SetGridVisibility( !IsGridVisible() );
if( m_galCanvasActive ) if( m_galCanvasActive )
{
m_galCanvas->GetGAL()->SetGridVisibility( IsGridVisible() ); m_galCanvas->GetGAL()->SetGridVisibility( IsGridVisible() );
m_galCanvas->GetView()->MarkTargetDirty( KiGfx::TARGET_NONCACHED );
}
RefreshCanvas(); RefreshCanvas();
} }
...@@ -392,11 +396,12 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event ) ...@@ -392,11 +396,12 @@ void EDA_DRAW_FRAME::OnSelectGrid( wxCommandEvent& event )
if( m_galCanvasActive ) if( m_galCanvasActive )
{ {
KiGfx::GAL* gal = m_galCanvas->GetGAL(); m_galCanvas->GetGAL()->SetGridSize( VECTOR2D( screen->GetGrid().m_Size.x,
gal->SetGridSize( VECTOR2D( screen->GetGrid().m_Size.x, screen->GetGrid().m_Size.y ) ); screen->GetGrid().m_Size.y ) );
m_galCanvas->GetView()->MarkTargetDirty( KiGfx::TARGET_NONCACHED );
} }
Refresh(); RefreshCanvas();
} }
...@@ -1011,6 +1016,8 @@ void EDA_DRAW_FRAME::UseGalCanvas( bool aEnable ) ...@@ -1011,6 +1016,8 @@ void EDA_DRAW_FRAME::UseGalCanvas( bool aEnable )
m_auimgr.GetPane( wxT( "DrawFrameGal" ) ).Show( aEnable ); m_auimgr.GetPane( wxT( "DrawFrameGal" ) ).Show( aEnable );
m_auimgr.Update(); m_auimgr.Update();
m_galCanvas->SetFocus();
m_galCanvasActive = aEnable; m_galCanvasActive = aEnable;
if( aEnable )
m_galCanvas->SetFocus();
} }
...@@ -267,7 +267,12 @@ public: ...@@ -267,7 +267,12 @@ public:
*/ */
inline void SetLayerVisible( int aLayer, bool aVisible = true ) inline void SetLayerVisible( int aLayer, bool aVisible = true )
{ {
m_layers[aLayer].enabled = aVisible; if( m_layers[aLayer].enabled != aVisible )
{
// Target has to be redrawn after changing its visibility
MarkTargetDirty( m_layers[aLayer].target );
m_layers[aLayer].enabled = aVisible;
}
} }
/** /**
......
...@@ -393,7 +393,7 @@ void PCB_LAYER_WIDGET::OnLayerVisible( LAYER_NUM aLayer, bool isVisible, bool is ...@@ -393,7 +393,7 @@ void PCB_LAYER_WIDGET::OnLayerVisible( LAYER_NUM aLayer, bool isVisible, bool is
brd->SetVisibleLayers( visibleLayers ); brd->SetVisibleLayers( visibleLayers );
EDA_DRAW_PANEL_GAL *galCanvas = myframe->GetGalCanvas(); EDA_DRAW_PANEL_GAL* galCanvas = myframe->GetGalCanvas();
if( galCanvas ) if( galCanvas )
{ {
KiGfx::VIEW* view = galCanvas->GetView(); KiGfx::VIEW* view = galCanvas->GetView();
...@@ -401,12 +401,7 @@ void PCB_LAYER_WIDGET::OnLayerVisible( LAYER_NUM aLayer, bool isVisible, bool is ...@@ -401,12 +401,7 @@ void PCB_LAYER_WIDGET::OnLayerVisible( LAYER_NUM aLayer, bool isVisible, bool is
} }
if( isFinal ) if( isFinal )
{ myframe->RefreshCanvas();
if( myframe->IsGalCanvasActive() )
galCanvas->Refresh();
else
myframe->RefreshCanvas();
}
} }
void PCB_LAYER_WIDGET::OnRenderColorChange( int aId, EDA_COLOR_T aColor ) void PCB_LAYER_WIDGET::OnRenderColorChange( int aId, EDA_COLOR_T aColor )
......
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