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.
This commit is contained in:
John Beard 2024-11-27 21:24:52 +08:00
parent e2136db5c2
commit 1d0ba992da

View File

@ -2345,6 +2345,11 @@ bool FABMASTER::loadFootprints( BOARD* aBoard )
fp->Value().SetLayer( F_Fab ); fp->Value().SetLayer( F_Fab );
fp->Value().SetVisible( false ); 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 ) for( auto& ref : refdes )
{ {
const GRAPHIC_TEXT *lsrc = const GRAPHIC_TEXT *lsrc =
@ -2363,9 +2368,14 @@ bool FABMASTER::loadFootprints( BOARD* aBoard )
} }
if( layer == F_SilkS || layer == B_SilkS ) if( layer == F_SilkS || layer == B_SilkS )
{
txt = &( fp->Reference() ); txt = &( fp->Reference() );
txt->SetVisible( true );
}
else else
{
txt = new PCB_TEXT( fp ); txt = new PCB_TEXT( fp );
}
if( src->mirror ) if( src->mirror )
{ {