Module editor loads the last edited footprint in GAL mode.
This commit is contained in:
parent
6d1417bafa
commit
9ee8d1a2a7
|
@ -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>
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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…
Reference in New Issue