Reduce footprint preview flickering in component selector

This commit is contained in:
Chris Pavlina 2017-02-19 14:54:36 -05:00
parent 69165aa0a0
commit 2e07d83461
2 changed files with 10 additions and 1 deletions

View File

@ -40,6 +40,9 @@ FOOTPRINT_PREVIEW_PANEL* FOOTPRINT_PREVIEW_PANEL::InstallOnPanel(
return NULL; return NULL;
} }
aPanel->SetBackgroundColour( *wxBLACK );
aPanel->SetForegroundColour( *wxWHITE );
auto sizer = new wxBoxSizer( wxVERTICAL ); auto sizer = new wxBoxSizer( wxVERTICAL );
sizer->Add( fpp, 1, wxALL | wxEXPAND, 0 ); sizer->Add( fpp, 1, wxALL | wxEXPAND, 0 );

View File

@ -199,6 +199,7 @@ FOOTPRINT_PREVIEW_PANEL::CacheFootprint ( const LIB_ID& aFPID )
void FOOTPRINT_PREVIEW_PANEL::renderFootprint( MODULE *module ) void FOOTPRINT_PREVIEW_PANEL::renderFootprint( MODULE *module )
{ {
Freeze();
GetView()->Clear(); GetView()->Clear();
module->SetParent ( &*m_dummyBoard ); module->SetParent ( &*m_dummyBoard );
module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, GetView(), _1 ) ); module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, GetView(), _1 ) );
@ -214,7 +215,6 @@ void FOOTPRINT_PREVIEW_PANEL::renderFootprint( MODULE *module )
if( bbox.GetSize().x > 0 && bbox.GetSize().y > 0 ) if( bbox.GetSize().x > 0 && bbox.GetSize().y > 0 )
{ {
// Autozoom // Autozoom
GetView()->SetViewport( BOX2D( bbox.GetOrigin(), bbox.GetSize() ) ); GetView()->SetViewport( BOX2D( bbox.GetOrigin(), bbox.GetSize() ) );
@ -223,6 +223,8 @@ void FOOTPRINT_PREVIEW_PANEL::renderFootprint( MODULE *module )
Refresh(); Refresh();
} }
Thaw();
} }
@ -275,6 +277,7 @@ void FOOTPRINT_PREVIEW_PANEL::OnLoaderThreadUpdate( wxCommandEvent& event )
void FOOTPRINT_PREVIEW_PANEL::SetStatusText( wxString const & aText ) void FOOTPRINT_PREVIEW_PANEL::SetStatusText( wxString const & aText )
{ {
Freeze();
if( m_label ) if( m_label )
{ {
m_label->SetLabel( aText ); m_label->SetLabel( aText );
@ -287,11 +290,13 @@ void FOOTPRINT_PREVIEW_PANEL::SetStatusText( wxString const & aText )
} }
GetParent()->Layout(); GetParent()->Layout();
Thaw();
} }
void FOOTPRINT_PREVIEW_PANEL::ClearStatus() void FOOTPRINT_PREVIEW_PANEL::ClearStatus()
{ {
Freeze();
if( m_label ) if( m_label )
{ {
m_label->SetLabel( wxEmptyString ); m_label->SetLabel( wxEmptyString );
@ -304,6 +309,7 @@ void FOOTPRINT_PREVIEW_PANEL::ClearStatus()
} }
GetParent()->Layout(); GetParent()->Layout();
Thaw();
} }