diff --git a/common/draw_panel_gal.cpp b/common/draw_panel_gal.cpp index 5d00f85654..f0be4b0316 100644 --- a/common/draw_panel_gal.cpp +++ b/common/draw_panel_gal.cpp @@ -168,8 +168,7 @@ void EDA_DRAW_PANEL_GAL::Refresh( bool aEraseBackground, const wxRect* aRect ) if( delta >= MinRefreshPeriod ) { - wxPaintEvent redrawEvent; - wxPostEvent( this, redrawEvent ); + ForceRefresh(); m_pendingRefresh = true; } else @@ -181,6 +180,13 @@ void EDA_DRAW_PANEL_GAL::Refresh( bool aEraseBackground, const wxRect* aRect ) } +void EDA_DRAW_PANEL_GAL::ForceRefresh() +{ + wxPaintEvent redrawEvent; + wxPostEvent( this, redrawEvent ); +} + + void EDA_DRAW_PANEL_GAL::SetEventDispatcher( TOOL_DISPATCHER* aEventDispatcher ) { m_eventDispatcher = aEventDispatcher; diff --git a/include/class_draw_panel_gal.h b/include/class_draw_panel_gal.h index 8795d94f29..d070548682 100644 --- a/include/class_draw_panel_gal.h +++ b/include/class_draw_panel_gal.h @@ -110,6 +110,12 @@ public: /// @copydoc wxWindow::Refresh() void Refresh( bool aEraseBackground = true, const wxRect* aRect = NULL ); + /** + * Function ForceRefresh() + * Forces a redraw. + */ + void ForceRefresh(); + /** * Function SetEventDispatcher() * Sets a dispatcher that processes events and forwards them to tools.