Switch canvas to Cairo if OpenGL is not supported on the first run
This commit is contained in:
parent
6bd708621b
commit
e4a6f2e523
|
@ -228,15 +228,20 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ):
|
|||
|
||||
// Switch to OpenGL, which will save the new setting if successful
|
||||
wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_OPENGL );
|
||||
auto handler = GetEventHandler();
|
||||
handler->ProcessEvent( evt );
|
||||
GetEventHandler()->ProcessEvent( evt );
|
||||
|
||||
// Switch back to Cairo if OpenGL is not supported
|
||||
if( GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
|
||||
{
|
||||
wxCommandEvent cairoEvt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO );
|
||||
GetEventHandler()->ProcessEvent( cairoEvt );
|
||||
}
|
||||
}
|
||||
else if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
|
||||
{
|
||||
// If they were on legacy, switch them to Cairo
|
||||
wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO );
|
||||
auto handler = GetEventHandler();
|
||||
handler->ProcessEvent( evt );
|
||||
GetEventHandler()->ProcessEvent( evt );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -484,15 +484,20 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
|
|||
|
||||
// Switch to OpenGL, which will save the new setting if successful
|
||||
wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_OPENGL );
|
||||
auto handler = GetEventHandler();
|
||||
handler->ProcessEvent( evt );
|
||||
GetEventHandler()->ProcessEvent( evt );
|
||||
|
||||
// Switch back to Cairo if OpenGL is not supported
|
||||
if( GetGalCanvas()->GetBackend() == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
|
||||
{
|
||||
wxCommandEvent cairoEvt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO );
|
||||
GetEventHandler()->ProcessEvent( cairoEvt );
|
||||
}
|
||||
}
|
||||
else if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
|
||||
{
|
||||
// If they were on legacy, switch them to Cairo
|
||||
wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO );
|
||||
auto handler = GetEventHandler();
|
||||
handler->ProcessEvent( evt );
|
||||
GetEventHandler()->ProcessEvent( evt );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue