More robust checks for OpenGL canvas visibility.

This commit is contained in:
Maciej Suminski 2016-05-20 12:06:08 +02:00
parent a30c8d7848
commit 3ca7026aa0
4 changed files with 16 additions and 3 deletions

View File

@ -479,7 +479,7 @@ void EDA_DRAW_PANEL_GAL::onRefreshTimer( wxTimerEvent& aEvent )
void EDA_DRAW_PANEL_GAL::onShowTimer( wxTimerEvent& aEvent )
{
if( IsShownOnScreen() )
if( m_gal && m_gal->IsVisible() )
{
m_onShowTimer.Stop();
OnShow();

View File

@ -85,6 +85,11 @@ public:
virtual ~CAIRO_GAL();
///> @copydoc GAL::IsVisible()
bool IsVisible() const override {
return IsShownOnScreen();
}
// ---------------
// Drawing methods
// ---------------

View File

@ -66,9 +66,12 @@ public:
GAL();
virtual ~GAL();
/// @brief Returns the initalization status for the canvas.
/// @brief Returns the initalization status for the canvas.
virtual bool IsInitialized() const { return true; }
/// @brief Returns true if the GAL canvas is visible on the screen.
virtual bool IsVisible() const { return true; }
// ---------------
// Drawing methods
// ---------------

View File

@ -83,9 +83,14 @@ public:
virtual ~OPENGL_GAL();
/// @copydoc GAL::IsInitialized()
/// @copydoc GAL::IsInitialized()
virtual bool IsInitialized() const { return IsShownOnScreen(); }
///> @copydoc GAL::IsVisible()
bool IsVisible() const override {
return IsShownOnScreen();
}
// ---------------
// Drawing methods
// ---------------