mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-15 02:33:15 +02:00
Prevent crash when zooming to preset in footprint chooser
Partial cherry-pick of 0cf866d4 Fixes https://gitlab.com/kicad/code/kicad/-/issues/21203
This commit is contained in:
parent
d3e5245606
commit
eb3606bf57
@ -460,6 +460,12 @@ int COMMON_TOOLS::doZoomToPreset( int idx, bool aCenterOnCursor )
|
|||||||
{
|
{
|
||||||
std::vector<double>& zoomList = m_toolMgr->GetSettings()->m_Window.zoom_factors;
|
std::vector<double>& zoomList = m_toolMgr->GetSettings()->m_Window.zoom_factors;
|
||||||
|
|
||||||
|
if( zoomList.empty() ) // When called from footprint chooser, zoomList is empty for some reason
|
||||||
|
zoomList = m_frame->config()->m_Window.zoom_factors;
|
||||||
|
// or: zoomList = Kiface().KifaceSettings()->m_Window.zoom_factors;
|
||||||
|
|
||||||
|
wxCHECK( !zoomList.empty(), 0 ); // To avoid a crash lower on scale from Fp Chooser panel
|
||||||
|
|
||||||
if( idx == 0 ) // Zoom Auto
|
if( idx == 0 ) // Zoom Auto
|
||||||
{
|
{
|
||||||
TOOL_EVENT dummy;
|
TOOL_EVENT dummy;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user