Deferred redraw for netnames.

This commit is contained in:
Jeff Young 2024-06-12 17:20:20 +01:00
parent b7161181e8
commit 0ca7a81181
3 changed files with 14 additions and 8 deletions

View File

@ -381,10 +381,16 @@ void EDA_DRAW_PANEL_GAL::onSize( wxSizeEvent& aEvent )
}
void EDA_DRAW_PANEL_GAL::RequestRefresh()
{
m_needIdleRefresh = true;
}
void EDA_DRAW_PANEL_GAL::Refresh( bool aEraseBackground, const wxRect* aRect )
{
if( !DoRePaint() )
m_needIdleRefresh = true;
RequestRefresh();
}
@ -588,7 +594,7 @@ void EDA_DRAW_PANEL_GAL::OnEvent( wxEvent& aEvent )
if( endDelta > timeLimit )
Refresh();
else
m_needIdleRefresh = true;
RequestRefresh();
}

View File

@ -145,6 +145,11 @@ public:
*/
void ForceRefresh();
/**
* Make sure a refresh gets done on the next idle event if it hasn't already.
*/
void RequestRefresh();
/**
* Set a dispatcher that processes events and forwards them to tools.
*

View File

@ -578,8 +578,6 @@ BOARD_ITEM_CONTAINER* PCB_EDIT_FRAME::GetModel() const
void PCB_EDIT_FRAME::redrawNetnames()
{
bool needs_refresh = false;
PCBNEW_SETTINGS* cfg = dynamic_cast<PCBNEW_SETTINGS*>( Kiface().KifaceSettings() );
if( !cfg || cfg->m_Display.m_NetNames < 2 )
@ -605,14 +603,11 @@ void PCB_EDIT_FRAME::redrawNetnames()
}
view->Update( track, KIGFX::REPAINT );
needs_refresh = true;
track->SetCachedViewport( viewport );
GetCanvas()->RequestRefresh();
}
}
}
if( needs_refresh )
GetCanvas()->Refresh();
}