Corrected GAL canvases screen size, so they do not include scroll bars.

This commit is contained in:
Maciej Suminski 2015-06-30 14:08:35 +02:00
parent b352ef9deb
commit d3c7b45438
2 changed files with 2 additions and 10 deletions

View File

@ -73,9 +73,6 @@ CAIRO_GAL::CAIRO_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( CAIRO_GAL::skipMouseEvent ) ); Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( CAIRO_GAL::skipMouseEvent ) );
#endif #endif
SetSize( aParent->GetSize() );
screenSize = VECTOR2I( aParent->GetSize() );
cursorPixels = NULL; cursorPixels = NULL;
cursorPixelsSaved = NULL; cursorPixelsSaved = NULL;
initCursor(); initCursor();
@ -303,8 +300,6 @@ void CAIRO_GAL::DrawCurve( const VECTOR2D& aStartPoint, const VECTOR2D& aControl
void CAIRO_GAL::ResizeScreen( int aWidth, int aHeight ) void CAIRO_GAL::ResizeScreen( int aWidth, int aHeight )
{ {
screenSize = VECTOR2I( aWidth, aHeight );
// Recreate the bitmaps // Recreate the bitmaps
deleteBitmaps(); deleteBitmaps();
allocateBitmaps(); allocateBitmaps();
@ -315,6 +310,7 @@ void CAIRO_GAL::ResizeScreen( int aWidth, int aHeight )
validCompositor = false; validCompositor = false;
SetSize( wxSize( aWidth, aHeight ) ); SetSize( wxSize( aWidth, aHeight ) );
screenSize = m_parent->GetClientSize(); // use client size to subtract scrollbars size
} }

View File

@ -96,9 +96,6 @@ OPENGL_GAL::OPENGL_GAL( wxWindow* aParent, wxEvtHandler* aMouseListener,
Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) ); Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
#endif #endif
SetSize( aParent->GetSize() );
screenSize = VECTOR2I( aParent->GetSize() );
// Grid color settings are different in Cairo and OpenGL // Grid color settings are different in Cairo and OpenGL
SetGridColor( COLOR4D( 0.8, 0.8, 0.8, 0.1 ) ); SetGridColor( COLOR4D( 0.8, 0.8, 0.8, 0.1 ) );
@ -539,8 +536,6 @@ void OPENGL_GAL::DrawCurve( const VECTOR2D& aStartPoint, const VECTOR2D& aContro
void OPENGL_GAL::ResizeScreen( int aWidth, int aHeight ) void OPENGL_GAL::ResizeScreen( int aWidth, int aHeight )
{ {
screenSize = VECTOR2I( aWidth, aHeight );
#ifdef RETINA_OPENGL_PATCH #ifdef RETINA_OPENGL_PATCH
const float scaleFactor = GetBackingScaleFactor(); const float scaleFactor = GetBackingScaleFactor();
#else #else
@ -552,6 +547,7 @@ void OPENGL_GAL::ResizeScreen( int aWidth, int aHeight )
isFramebufferInitialized = false; isFramebufferInitialized = false;
wxGLCanvas::SetSize( aWidth, aHeight ); wxGLCanvas::SetSize( aWidth, aHeight );
screenSize = m_parent->GetClientSize(); // use client size to subtract scrollbars size
} }