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 ) );
#endif
SetSize( aParent->GetSize() );
screenSize = VECTOR2I( aParent->GetSize() );
cursorPixels = NULL;
cursorPixelsSaved = NULL;
initCursor();
@ -303,8 +300,6 @@ void CAIRO_GAL::DrawCurve( const VECTOR2D& aStartPoint, const VECTOR2D& aControl
void CAIRO_GAL::ResizeScreen( int aWidth, int aHeight )
{
screenSize = VECTOR2I( aWidth, aHeight );
// Recreate the bitmaps
deleteBitmaps();
allocateBitmaps();
@ -315,6 +310,7 @@ void CAIRO_GAL::ResizeScreen( int aWidth, int aHeight )
validCompositor = false;
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 ) );
#endif
SetSize( aParent->GetSize() );
screenSize = VECTOR2I( aParent->GetSize() );
// Grid color settings are different in Cairo and OpenGL
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 )
{
screenSize = VECTOR2I( aWidth, aHeight );
#ifdef RETINA_OPENGL_PATCH
const float scaleFactor = GetBackingScaleFactor();
#else
@ -552,6 +547,7 @@ void OPENGL_GAL::ResizeScreen( int aWidth, int aHeight )
isFramebufferInitialized = false;
wxGLCanvas::SetSize( aWidth, aHeight );
screenSize = m_parent->GetClientSize(); // use client size to subtract scrollbars size
}