Loading pcbnew/loadcmp.cpp +1 −9 Original line number Diff line number Diff line Loading @@ -49,7 +49,6 @@ #include <class_board.h> #include <class_module.h> #include <io_mgr.h> #include <tool/tool_manager.h> #include <pcbnew.h> #include <module_editor_frame.h> Loading Loading @@ -121,14 +120,7 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule ) Zoom_Automatique( false ); if( IsGalCanvasActive() ) { static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->DisplayBoard( GetBoard() ); m_Pcb->ComputeBoundingBox( false ); EDA_RECT boardBbox = m_Pcb->GetBoundingBox(); GetGalCanvas()->GetView()->SetViewport( BOX2D( boardBbox.GetOrigin(), boardBbox.GetSize() ) ); m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD ); } updateView(); return true; } Loading pcbnew/modedit.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -935,8 +935,7 @@ void FOOTPRINT_EDIT_FRAME::UseGalCanvas( bool aEnable ) if( aEnable ) { SetBoard( m_Pcb ); m_toolManager->ResetTools( TOOL_BASE::GAL_SWITCH ); updateView(); GetGalCanvas()->StartDrawing(); } } pcbnew/module_editor_frame.h +3 −0 Original line number Diff line number Diff line Loading @@ -439,6 +439,9 @@ protected: */ void updateTitle(); /// Reloads displayed items and sets view. void updateView(); /// The libPath is not publicly visible, grab it from the FP_LIB_TABLE if we must. const wxString getLibPath(); Loading pcbnew/moduleframe.cpp +26 −0 Original line number Diff line number Diff line Loading @@ -680,3 +680,29 @@ void FOOTPRINT_EDIT_FRAME::updateTitle() SetTitle( title ); } void FOOTPRINT_EDIT_FRAME::updateView() { static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->DisplayBoard( GetBoard() ); m_Pcb->ComputeBoundingBox( false ); EDA_RECT boardBbox = m_Pcb->GetBoundingBox(); BOX2D bbox; if( boardBbox.GetSize().x > 0 && boardBbox.GetSize().y > 0 ) { bbox.SetOrigin( VECTOR2D( boardBbox.GetOrigin() ) ); bbox.SetSize( VECTOR2D( boardBbox.GetSize() ) ); } else { // Default empty view bbox.SetOrigin( VECTOR2D( -1000, -1000 ) ); bbox.SetSize( VECTOR2D( 2000, 2000 ) ); } GetGalCanvas()->GetView()->SetViewport( bbox ); m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD ); } Loading
pcbnew/loadcmp.cpp +1 −9 Original line number Diff line number Diff line Loading @@ -49,7 +49,6 @@ #include <class_board.h> #include <class_module.h> #include <io_mgr.h> #include <tool/tool_manager.h> #include <pcbnew.h> #include <module_editor_frame.h> Loading Loading @@ -121,14 +120,7 @@ bool FOOTPRINT_EDIT_FRAME::Load_Module_From_BOARD( MODULE* aModule ) Zoom_Automatique( false ); if( IsGalCanvasActive() ) { static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->DisplayBoard( GetBoard() ); m_Pcb->ComputeBoundingBox( false ); EDA_RECT boardBbox = m_Pcb->GetBoundingBox(); GetGalCanvas()->GetView()->SetViewport( BOX2D( boardBbox.GetOrigin(), boardBbox.GetSize() ) ); m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD ); } updateView(); return true; } Loading
pcbnew/modedit.cpp +1 −2 Original line number Diff line number Diff line Loading @@ -935,8 +935,7 @@ void FOOTPRINT_EDIT_FRAME::UseGalCanvas( bool aEnable ) if( aEnable ) { SetBoard( m_Pcb ); m_toolManager->ResetTools( TOOL_BASE::GAL_SWITCH ); updateView(); GetGalCanvas()->StartDrawing(); } }
pcbnew/module_editor_frame.h +3 −0 Original line number Diff line number Diff line Loading @@ -439,6 +439,9 @@ protected: */ void updateTitle(); /// Reloads displayed items and sets view. void updateView(); /// The libPath is not publicly visible, grab it from the FP_LIB_TABLE if we must. const wxString getLibPath(); Loading
pcbnew/moduleframe.cpp +26 −0 Original line number Diff line number Diff line Loading @@ -680,3 +680,29 @@ void FOOTPRINT_EDIT_FRAME::updateTitle() SetTitle( title ); } void FOOTPRINT_EDIT_FRAME::updateView() { static_cast<PCB_DRAW_PANEL_GAL*>( GetGalCanvas() )->DisplayBoard( GetBoard() ); m_Pcb->ComputeBoundingBox( false ); EDA_RECT boardBbox = m_Pcb->GetBoundingBox(); BOX2D bbox; if( boardBbox.GetSize().x > 0 && boardBbox.GetSize().y > 0 ) { bbox.SetOrigin( VECTOR2D( boardBbox.GetOrigin() ) ); bbox.SetSize( VECTOR2D( boardBbox.GetSize() ) ); } else { // Default empty view bbox.SetOrigin( VECTOR2D( -1000, -1000 ) ); bbox.SetSize( VECTOR2D( 2000, 2000 ) ); } GetGalCanvas()->GetView()->SetViewport( bbox ); m_toolManager->ResetTools( TOOL_BASE::MODEL_RELOAD ); }