From 786ac8143e9aaff9999c5ef845c09940d01b1fa7 Mon Sep 17 00:00:00 2001 From: Thomas Pointhuber Date: Tue, 25 Jul 2017 18:09:22 +0200 Subject: [PATCH] Request refresh of 3d canvas on resize event This is a partial fix for https://bugs.launchpad.net/kicad/+bug/1695897 --- 3d-viewer/3d_canvas/eda_3d_canvas.cpp | 5 +++++ 3d-viewer/3d_canvas/eda_3d_canvas.h | 2 ++ 2 files changed, 7 insertions(+) diff --git a/3d-viewer/3d_canvas/eda_3d_canvas.cpp b/3d-viewer/3d_canvas/eda_3d_canvas.cpp index e1d54dc74c..6f8af39b6f 100644 --- a/3d-viewer/3d_canvas/eda_3d_canvas.cpp +++ b/3d-viewer/3d_canvas/eda_3d_canvas.cpp @@ -82,6 +82,7 @@ BEGIN_EVENT_TABLE( EDA_3D_CANVAS, wxGLCanvas ) ID_POPUP_3D_VIEW_END, EDA_3D_CANVAS::OnPopUpMenu ) EVT_CLOSE( EDA_3D_CANVAS::OnCloseWindow ) + EVT_SIZE( EDA_3D_CANVAS::OnResize ) END_EVENT_TABLE() @@ -188,6 +189,10 @@ void EDA_3D_CANVAS::OnCloseWindow( wxCloseEvent &event ) event.Skip(); } +void EDA_3D_CANVAS::OnResize( wxSizeEvent &event ) +{ + this->Request_refresh(); +} bool EDA_3D_CANVAS::initializeOpenGL() { diff --git a/3d-viewer/3d_canvas/eda_3d_canvas.h b/3d-viewer/3d_canvas/eda_3d_canvas.h index b7b4a77f6e..f58b2dc92c 100644 --- a/3d-viewer/3d_canvas/eda_3d_canvas.h +++ b/3d-viewer/3d_canvas/eda_3d_canvas.h @@ -159,6 +159,8 @@ class EDA_3D_CANVAS : public HIDPI_GL_CANVAS */ void OnCloseWindow( wxCloseEvent &event ); + void OnResize( wxSizeEvent &event ); + void OnTimerTimeout_Redraw( wxTimerEvent& event ); DECLARE_EVENT_TABLE()