From ea7cde81ebc4237ff4ebb080771a0107ca0ed983 Mon Sep 17 00:00:00 2001 From: John Beard Date: Wed, 27 Nov 2024 21:24:52 +0800 Subject: [PATCH] Fabmaster: don't show default refdeses All the footprints have a ref-des field by default in KiCad, but if the silkscreen text isn't present in the imported file, we should hide it. If we see a silkscreen refdes, _then_ show it. (cherry picked from commit 1d0ba992da1629120789dfe3ce9eecdaee2ba165) --- pcbnew/pcb_io/fabmaster/import_fabmaster.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp b/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp index ae21a408c6..15713a09be 100644 --- a/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp +++ b/pcbnew/pcb_io/fabmaster/import_fabmaster.cpp @@ -2330,6 +2330,11 @@ bool FABMASTER::loadFootprints( BOARD* aBoard ) fp->Value().SetLayer( F_Fab ); fp->Value().SetVisible( false ); + // Set refdes invisible until we find the text for it + // (otherwise we'll plonk a default-sized ref-des on the silkscreen layer + // which wasn't there in the imported file) + fp->Reference().SetVisible( false ); + for( auto& ref : refdes ) { const GRAPHIC_TEXT *lsrc = @@ -2347,9 +2352,14 @@ bool FABMASTER::loadFootprints( BOARD* aBoard ) } if( layer == F_SilkS || layer == B_SilkS ) + { txt = &( fp->Reference() ); + txt->SetVisible( true ); + } else + { txt = new PCB_TEXT( fp ); + } if( src->mirror ) {