diff --git a/eeschema/lib_field.cpp b/eeschema/lib_field.cpp index aa5d49de33..b77462920b 100644 --- a/eeschema/lib_field.cpp +++ b/eeschema/lib_field.cpp @@ -357,6 +357,9 @@ void LIB_FIELD::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& SCH_RENDER_SETTINGS* renderSettings = getRenderSettings( aPlotter ); + if( !IsVisible() && !renderSettings->m_ShowHiddenFields ) + return; + // Calculate the text orientation, according to the symbol orientation/mirror. EDA_ANGLE orient = GetTextAngle(); diff --git a/eeschema/lib_pin.cpp b/eeschema/lib_pin.cpp index 35f7e48918..81ed312140 100644 --- a/eeschema/lib_pin.cpp +++ b/eeschema/lib_pin.cpp @@ -1162,14 +1162,17 @@ void LIB_PIN::Rotate( const VECTOR2I& aCenter, bool aRotateCCW ) void LIB_PIN::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts, int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed ) { - if( !IsVisible() || aBackground ) + if( aBackground ) return; SCH_RENDER_SETTINGS* renderSettings = getRenderSettings( aPlotter ); - const SYMBOL* part = GetParentSymbol(); - PIN_ORIENTATION orient = PinDrawOrient( renderSettings->m_Transform ); - VECTOR2I pos = renderSettings->TransformCoordinate( m_position ) + aOffset; + if( !IsVisible() && !renderSettings->m_ShowHiddenPins ) + return; + + const SYMBOL* part = GetParentSymbol(); + PIN_ORIENTATION orient = PinDrawOrient( renderSettings->m_Transform ); + VECTOR2I pos = renderSettings->TransformCoordinate( m_position ) + aOffset; PlotPinType( aPlotter, pos, orient, aDimmed ); PlotPinTexts( aPlotter, pos, orient, part->GetPinNameOffset(), part->GetShowPinNumbers(), diff --git a/eeschema/sch_field.cpp b/eeschema/sch_field.cpp index 88d74066c6..b9862075fb 100644 --- a/eeschema/sch_field.cpp +++ b/eeschema/sch_field.cpp @@ -1157,11 +1157,11 @@ void SCH_FIELD::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& if( GetShownText( sheet, true ).IsEmpty() || aBackground ) return; - RENDER_SETTINGS* settings = aPlotter->RenderSettings(); - COLOR4D color = settings->GetLayerColor( GetLayer() ); - int penWidth = GetEffectiveTextPenWidth( settings->GetDefaultPenWidth() ); + SCH_RENDER_SETTINGS* renderSettings = getRenderSettings( aPlotter ); + COLOR4D color = renderSettings->GetLayerColor( GetLayer() ); + int penWidth = GetEffectiveTextPenWidth( renderSettings->GetDefaultPenWidth() ); - COLOR4D bg = settings->GetBackgroundColor();; + COLOR4D bg = renderSettings->GetBackgroundColor();; if( bg == COLOR4D::UNSPECIFIED || !aPlotter->GetColorMode() ) bg = COLOR4D::WHITE; @@ -1169,12 +1169,12 @@ void SCH_FIELD::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& if( aPlotter->GetColorMode() && GetTextColor() != COLOR4D::UNSPECIFIED ) color = GetTextColor(); - penWidth = std::max( penWidth, settings->GetMinPenWidth() ); + penWidth = std::max( penWidth, renderSettings->GetMinPenWidth() ); // clamp the pen width to be sure the text is readable penWidth = std::min( penWidth, std::min( GetTextSize().x, GetTextSize().y ) / 4 ); - if( !IsVisible() ) + if( !IsVisible() && !renderSettings->m_ShowHiddenFields ) return; // Calculate the text orientation, according to the symbol orientation/mirror @@ -1219,13 +1219,13 @@ void SCH_FIELD::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& else if( m_parent && m_parent->Type() == SCH_GLOBAL_LABEL_T ) { SCH_GLOBALLABEL* label = static_cast( m_parent ); - textpos += label->GetSchematicTextOffset( settings ); + textpos += label->GetSchematicTextOffset( renderSettings ); } KIFONT::FONT* font = GetFont(); if( !font ) - font = KIFONT::FONT::GetFont( settings->GetDefaultFont(), IsBold(), IsItalic() ); + font = KIFONT::FONT::GetFont( renderSettings->GetDefaultFont(), IsBold(), IsItalic() ); TEXT_ATTRIBUTES attrs = GetAttributes(); attrs.m_StrokeWidth = penWidth; @@ -1250,7 +1250,7 @@ void SCH_FIELD::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& for( const std::pair& page : pages ) pageHrefs.push_back( wxT( "#" ) + page.first ); - bbox.Offset( label->GetSchematicTextOffset( settings ) ); + bbox.Offset( label->GetSchematicTextOffset( renderSettings ) ); aPlotter->HyperlinkMenu( bbox, pageHrefs ); }