Corrected wxDC objects used by EDA_DRAW_PANEL_GAL & OPENGL_GAL.

This commit is contained in:
jean-pierre charras 2016-06-03 15:46:11 +02:00 committed by Maciej Suminski
parent dbef1d41c5
commit 3e2cae946c
3 changed files with 7 additions and 6 deletions

View File

@ -153,6 +153,9 @@ void EDA_DRAW_PANEL_GAL::SetFocus()
void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
{
// This is required even though dc is not used otherwise.
wxPaintDC dc(this);
m_pendingRefresh = false;
if( m_drawing )

View File

@ -40,6 +40,7 @@
#include <limits>
#include <boost/bind.hpp>
using namespace KIGFX;
#include "bitmap_font_img.c"
@ -52,6 +53,7 @@ wxGLContext* OPENGL_GAL::glContext = NULL;
int OPENGL_GAL::instanceCounter = 0;
bool OPENGL_GAL::isBitmapFontLoaded = false;
OPENGL_GAL::OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
wxEvtHandler* aPaintListener, const wxString& aName ) :
wxGLCanvas( aParent, wxID_ANY, (int*) glAttributes, wxDefaultPosition, wxDefaultSize,
@ -164,7 +166,6 @@ void OPENGL_GAL::BeginDrawing()
#endif /* __WXDEBUG__ */
SetCurrent( *glContext );
clientDC = new wxClientDC( this );
#ifdef RETINA_OPENGL_PATCH
const float scaleFactor = GetBackingScaleFactor();
@ -300,8 +301,6 @@ void OPENGL_GAL::EndDrawing()
SwapBuffers();
delete clientDC;
#ifdef __WXDEBUG__
prof_end( &totalRealTime );
wxLogTrace( "GAL_PROFILE", wxT( "OPENGL_GAL::EndDrawing(): %.1f ms" ), totalRealTime.msecs() );

View File

@ -52,6 +52,7 @@ namespace KIGFX
{
class SHADER;
/**
* @brief Class OpenGL_GAL is the OpenGL implementation of the Graphics Abstraction Layer.
*
@ -62,7 +63,6 @@ class SHADER;
class OPENGL_GAL : public GAL, public wxGLCanvas
{
public:
/**
* @brief Constructor OPENGL_GAL
*
@ -273,7 +273,6 @@ private:
static const int CIRCLE_POINTS = 64; ///< The number of points for circle approximation
static const int CURVE_POINTS = 32; ///< The number of points for curve approximation
wxClientDC* clientDC; ///< Drawing context
static wxGLContext* glContext; ///< OpenGL context of wxWidgets
wxEvtHandler* mouseListener;
wxEvtHandler* paintListener;