Corrected wxDC objects used by EDA_DRAW_PANEL_GAL & OPENGL_GAL.
This commit is contained in:
parent
dbef1d41c5
commit
3e2cae946c
|
@ -64,7 +64,7 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin
|
|||
|
||||
SwitchBackend( aGalType );
|
||||
SetBackgroundStyle( wxBG_STYLE_CUSTOM );
|
||||
|
||||
|
||||
// Scrollbars broken in GAL on OSX
|
||||
#ifdef __WXMAC__
|
||||
ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER );
|
||||
|
@ -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 )
|
||||
|
|
|
@ -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() );
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue