Browse Source

Fix scrollbars in macOS GAL canvases

pull/7/merge
Jon Evans 8 years ago
committed by jean-pierre charras
parent
commit
93de82f0b2
  1. 11
      common/draw_panel_gal.cpp
  2. 4
      common/gal/cairo/cairo_gal.cpp
  3. 4
      common/gal/opengl/opengl_gal.cpp

11
common/draw_panel_gal.cpp

@ -71,12 +71,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 );
#else
ShowScrollbars( wxSHOW_SB_ALWAYS, wxSHOW_SB_ALWAYS );
#endif
EnableScrolling( false, false ); // otherwise Zoom Auto disables GAL canvas
m_view = new KIGFX::VIEW( true );
@ -169,10 +164,7 @@ void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
m_drawing = true;
KIGFX::RENDER_SETTINGS* settings = static_cast<KIGFX::RENDER_SETTINGS*>( m_painter->GetSettings() );
// Scrollbars broken in GAL on OSX
#ifndef __WXMAC__
m_viewControls->UpdateScrollbars();
#endif
m_view->UpdateItems();
@ -222,7 +214,8 @@ void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
void EDA_DRAW_PANEL_GAL::onSize( wxSizeEvent& aEvent )
{
m_gal->ResizeScreen( aEvent.GetSize().x, aEvent.GetSize().y );
wxSize clientSize = GetClientSize();
m_gal->ResizeScreen( clientSize.x, clientSize.y );
m_view->MarkTargetDirty( KIGFX::TARGET_CACHED );
m_view->MarkTargetDirty( KIGFX::TARGET_NONCACHED );
}

4
common/gal/cairo/cairo_gal.cpp

@ -90,8 +90,8 @@ CAIRO_GAL::CAIRO_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions,
Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( CAIRO_GAL::skipMouseEvent ) );
#endif
SetSize( aParent->GetSize() );
screenSize = VECTOR2I( aParent->GetSize() );
SetSize( aParent->GetClientSize() );
screenSize = VECTOR2I( aParent->GetClientSize() );
// Grid color settings are different in Cairo and OpenGL
SetGridColor( COLOR4D( 0.1, 0.1, 0.1, 0.8 ) );

4
common/gal/opengl/opengl_gal.cpp

@ -120,8 +120,8 @@ OPENGL_GAL::OPENGL_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions, wxWindow* aParent,
Connect( wxEVT_ENTER_WINDOW, wxMouseEventHandler( OPENGL_GAL::skipMouseEvent ) );
#endif
SetSize( aParent->GetSize() );
screenSize = VECTOR2I( aParent->GetSize() );
SetSize( aParent->GetClientSize() );
screenSize = VECTOR2I( aParent->GetClientSize() );
// Grid color settings are different in Cairo and OpenGL
SetGridColor( COLOR4D( 0.8, 0.8, 0.8, 0.1 ) );

Loading…
Cancel
Save