From b123f7f35fcf0276ff21f19983c8d560f626bb2e Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Thu, 28 Apr 2022 18:34:44 -0400 Subject: [PATCH] Extra sanity to avoid a gal repaint when not initialized --- common/draw_panel_gal.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/draw_panel_gal.cpp b/common/draw_panel_gal.cpp index a4e0a55fd6..a07283a1ac 100644 --- a/common/draw_panel_gal.cpp +++ b/common/draw_panel_gal.cpp @@ -185,6 +185,9 @@ void EDA_DRAW_PANEL_GAL::DoRePaint() m_viewControls->UpdateScrollbars(); + if( !m_drawingEnabled ) + return; + if( !m_gal->IsVisible() ) return; @@ -388,10 +391,10 @@ void EDA_DRAW_PANEL_GAL::StartDrawing() void EDA_DRAW_PANEL_GAL::StopDrawing() { + m_refreshTimer.Stop(); m_drawingEnabled = false; Disconnect( wxEVT_PAINT, wxPaintEventHandler( EDA_DRAW_PANEL_GAL::onPaint ), nullptr, this ); m_pendingRefresh = false; - m_refreshTimer.Stop(); }