From 887c740c2e73555471d0d97aec43a2c9e9f07eab Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Sat, 4 Feb 2023 11:11:04 +0100 Subject: [PATCH] Limit the number of potential netnames Don't set text if outside of the clipbox. Text is non-cached so will get redrawn on zoom Fixes https://gitlab.com/kicad/code/kicad/issues/13572 --- pcbnew/pcb_painter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 8c0984631d..0344e77f62 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -738,7 +738,9 @@ void PCB_PAINTER::draw( const PCB_TRACK* aTrack, int aLayer ) VECTOR2I textPosition = VECTOR2D( start ) * static_cast( num_names - ii ) / ( num_names + 1 ) + VECTOR2D( end ) * static_cast( ii + 1 ) / ( num_names + 1 ); - m_gal->BitmapText( netName, textPosition, textOrientation ); + + if( clipBox.Contains( textPosition ) ) + m_gal->BitmapText( netName, textPosition, textOrientation ); } return;