diff --git a/pcbnew/pcb_draw_panel_gal.cpp b/pcbnew/pcb_draw_panel_gal.cpp index 4cd0486aca..1d800982d5 100644 --- a/pcbnew/pcb_draw_panel_gal.cpp +++ b/pcbnew/pcb_draw_panel_gal.cpp @@ -441,11 +441,10 @@ BOX2I PCB_DRAW_PANEL_GAL::GetDefaultViewBBox() const return m_worksheet->ViewBBox(); // The footprint editor frame has no worksheet, but the best default view box is the - // view box able to show the current footprint - FOOTPRINT_EDIT_FRAME* fp_frame; - - if( ( fp_frame = dynamic_cast( m_edaFrame ) ) ) + // view box able to show the current footprint, even if some layers are not shown + if( m_edaFrame->IsType( FRAME_PCB_MODULE_EDITOR ) ) { + PCB_BASE_FRAME* fp_frame = static_cast( m_edaFrame ); MODULE* footprint = fp_frame->GetBoard()->m_Modules; if( footprint )