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
|
// Switch to OpenGL, which will save the new setting if successful
|
||||||
wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_OPENGL );
|
wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_OPENGL );
|
||||||
auto handler = GetEventHandler();
|
GetEventHandler()->ProcessEvent( evt );
|
||||||
handler->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 )
|
else if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
|
||||||
{
|
{
|
||||||
// If they were on legacy, switch them to Cairo
|
// If they were on legacy, switch them to Cairo
|
||||||
wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO );
|
wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO );
|
||||||
auto handler = GetEventHandler();
|
GetEventHandler()->ProcessEvent( evt );
|
||||||
handler->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
|
// Switch to OpenGL, which will save the new setting if successful
|
||||||
wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_OPENGL );
|
wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_OPENGL );
|
||||||
auto handler = GetEventHandler();
|
GetEventHandler()->ProcessEvent( evt );
|
||||||
handler->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 )
|
else if( canvasType == EDA_DRAW_PANEL_GAL::GAL_TYPE_NONE )
|
||||||
{
|
{
|
||||||
// If they were on legacy, switch them to Cairo
|
// If they were on legacy, switch them to Cairo
|
||||||
wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO );
|
wxCommandEvent evt( wxEVT_MENU, ID_MENU_CANVAS_CAIRO );
|
||||||
auto handler = GetEventHandler();
|
GetEventHandler()->ProcessEvent( evt );
|
||||||
handler->ProcessEvent( evt );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue