diff --git a/common/drawpanel_gal.cpp b/common/drawpanel_gal.cpp index 77d8faf8fd..107e8ff543 100644 --- a/common/drawpanel_gal.cpp +++ b/common/drawpanel_gal.cpp @@ -46,8 +46,9 @@ EDA_DRAW_PANEL_GAL::EDA_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWin GalType aGalType ) : wxWindow( aParentWindow, aWindowId, aPosition, aSize ) { - m_gal = NULL; - m_view = NULL; + m_gal = NULL; + m_view = NULL; + m_painter = NULL; m_galShaderPath = std::string( ::wxGetCwd().mb_str() ) + "/../../gal/opengl/shader/"; diff --git a/common/gal/cairo/cairo_gal.cpp b/common/gal/cairo/cairo_gal.cpp index 1a6accc113..ff0fb47b39 100644 --- a/common/gal/cairo/cairo_gal.cpp +++ b/common/gal/cairo/cairo_gal.cpp @@ -25,7 +25,7 @@ */ #include -#include +#include #include #include @@ -93,6 +93,9 @@ CAIRO_GAL::CAIRO_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener, CAIRO_GAL::~CAIRO_GAL() { + delete cursorPixels; + delete cursorPixelsSaved; + // TODO Deleting of list contents like groups and paths deleteBitmaps(); } @@ -192,11 +195,10 @@ void CAIRO_GAL::EndDrawing() *wxOutputPtr++ = value & 0xff; // Blue pixel } - wxImage img( (int) screenSize.x, (int) screenSize.y, (unsigned char*) wxOutput, true); + wxImage img( (int) screenSize.x, (int) screenSize.y, (unsigned char*) wxOutput, true ); wxBitmap bmp( img ); wxClientDC client_dc( this ); wxBufferedDC dc; - // client_dc.DrawBitmap(bmp, 0, 0, false); dc.Init( &client_dc, bmp ); // Destroy Cairo objects @@ -909,7 +911,7 @@ void CAIRO_GAL::allocateBitmaps() bitmapBuffer = new unsigned int[bufferSize]; bitmapBufferBackup = new unsigned int[bufferSize]; - wxOutput = new unsigned char[bufferSize * 4]; + wxOutput = new unsigned char[bufferSize * 3]; } diff --git a/common/gal/opengl/opengl_gal.cpp b/common/gal/opengl/opengl_gal.cpp index 1bb9bb3c33..e75b8265bd 100644 --- a/common/gal/opengl/opengl_gal.cpp +++ b/common/gal/opengl/opengl_gal.cpp @@ -40,14 +40,7 @@ using namespace KiGfx; // Prototypes void InitTesselatorCallbacks( GLUtesselator* aTesselator ); -// FIXME Checking of attributes - -// #if defined(__WXGTK__) const int glAttributes[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 16, 0 }; -// #elif defined(__WXMSW__) -// #define glAttributes NULL -// #endif - OPENGL_GAL::OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener, wxEvtHandler* aPaintListener, bool isUseShaders, const wxString& aName ) : diff --git a/common/view/view.cpp b/common/view/view.cpp index 7616f5397c..d91036cd30 100644 --- a/common/view/view.cpp +++ b/common/view/view.cpp @@ -150,6 +150,10 @@ VIEW::VIEW( bool aIsDynamic, bool aUseGroups ) : VIEW::~VIEW() { + BOOST_FOREACH( LayerMap::value_type& l, m_layers ) + { + delete l.second.items; + } } diff --git a/common/view/wx_view_controls.cpp b/common/view/wx_view_controls.cpp index 67b5cf603d..f24a71aa50 100644 --- a/common/view/wx_view_controls.cpp +++ b/common/view/wx_view_controls.cpp @@ -126,7 +126,7 @@ void WX_VIEW_CONTROLS::onButton( wxMouseEvent& event ) { m_isDragPanning = true; m_dragStartPoint = VECTOR2D( event.GetX(), event.GetY() ); - m_lookStartPoint = m_view->GetCenter(); // ookAtPoint(); + m_lookStartPoint = m_view->GetCenter(); } else if( event.RightUp() ) { diff --git a/include/gal/graphics_abstraction_layer.h b/include/gal/graphics_abstraction_layer.h index b6a114ca3c..245508b7a2 100644 --- a/include/gal/graphics_abstraction_layer.h +++ b/include/gal/graphics_abstraction_layer.h @@ -644,7 +644,7 @@ public: */ virtual void DrawCursor( VECTOR2D aCursorPosition ) = 0; - void AdvanceDepth() + inline void AdvanceDepth() { layerDepth -= 0.1; // fixme: there should be a minimum step } @@ -652,7 +652,7 @@ public: /** * @brief Stores current drawing depth on the depth stack. */ - void PushDepth() + inline void PushDepth() { depthStack.push( layerDepth ); } @@ -660,7 +660,7 @@ public: /** * @brief Restores previously stored drawing depth for the depth stack. */ - void PopDepth() + inline void PopDepth() { layerDepth = depthStack.top(); depthStack.pop();