Move early exit higher in netname redraw
If the track is outside of the viewbox, GetLOD returns HIDE. This needs to be handled quickly in the loop before further processing Fixes https://gitlab.com/kicad/code/kicad/issues/13572
This commit is contained in:
parent
3cc960a872
commit
f35a02d57a
|
@ -532,20 +532,19 @@ void PCB_EDIT_FRAME::redrawNetnames( wxTimerEvent& aEvent )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
KIGFX::VIEW* view = GetCanvas()->GetView();
|
KIGFX::VIEW* view = GetCanvas()->GetView();
|
||||||
|
double scale = view->GetScale();
|
||||||
|
|
||||||
for( PCB_TRACK* track : GetBoard()->Tracks() )
|
for( PCB_TRACK* track : GetBoard()->Tracks() )
|
||||||
{
|
{
|
||||||
double lod = track->ViewGetLOD( GetNetnameLayer( track->GetLayer() ), view );
|
double lod = track->ViewGetLOD( GetNetnameLayer( track->GetLayer() ), view );
|
||||||
double scale = view->GetScale();
|
|
||||||
|
if( lod < scale )
|
||||||
|
continue;
|
||||||
|
|
||||||
if( lod != track->GetCachedLOD() || scale != track->GetCachedScale() )
|
if( lod != track->GetCachedLOD() || scale != track->GetCachedScale() )
|
||||||
{
|
|
||||||
if( lod < view->GetScale() )
|
|
||||||
{
|
{
|
||||||
view->Update( track, KIGFX::REPAINT );
|
view->Update( track, KIGFX::REPAINT );
|
||||||
needs_refresh = true;
|
needs_refresh = true;
|
||||||
}
|
|
||||||
|
|
||||||
track->SetCachedLOD( lod );
|
track->SetCachedLOD( lod );
|
||||||
track->SetCachedScale( scale );
|
track->SetCachedScale( scale );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue