Browse Source

Eeschema: fix incorrect plot of SCH_TABLE items.

revert-0c36e162
jean-pierre charras 8 months ago
parent
commit
ba85c54f81
  1. 5
      eeschema/sch_shape.cpp
  2. 14
      eeschema/sch_table.cpp
  3. 3
      eeschema/sch_tablecell.cpp
  4. 3
      eeschema/sch_textbox.cpp

5
eeschema/sch_shape.cpp

@ -143,6 +143,9 @@ void SCH_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS&
if( IsPrivate() )
return;
// note: if aBodyStyle == -1 the outline shape is not plotted. Only the filled area
// is plotted (used to plot cells for SCH_TABLE items
SCH_RENDER_SETTINGS* renderSettings = getRenderSettings( aPlotter );
int pen_size = GetEffectivePenWidth( renderSettings );
@ -221,7 +224,7 @@ void SCH_SHAPE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS&
else
fill = FILL_T::NO_FILL;
pen_size = GetEffectivePenWidth( renderSettings );
pen_size = aBodyStyle == -1 ? 0 : GetEffectivePenWidth( renderSettings );
}
if( bg == COLOR4D::UNSPECIFIED || !aPlotter->GetColorMode() )

14
eeschema/sch_table.cpp

@ -384,10 +384,14 @@ void SCH_TABLE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS&
for( int row = 0; row < GetRowCount(); ++row )
{
SCH_TABLECELL* cell = GetCell( row, col );
VECTOR2I topRight( cell->GetEndX(), cell->GetStartY() );
if( !cell->GetTextAngle().IsHorizontal() )
topRight = VECTOR2I( cell->GetStartX(), cell->GetEndY() );
if( cell->GetColSpan() > 0 && cell->GetRowSpan() > 0 )
{
aPlotter->MoveTo( VECTOR2I( cell->GetEndX(), cell->GetStartY() ) );
aPlotter->MoveTo( topRight );
aPlotter->FinishTo( VECTOR2I( cell->GetEndX(), cell->GetEndY() ) );
}
}
@ -400,11 +404,15 @@ void SCH_TABLE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS&
{
for( int col = 0; col < GetColCount(); ++col )
{
SCH_TABLECELL* cell = GetCell( row, 0 );
SCH_TABLECELL* cell = GetCell( row, col );
VECTOR2I botLeft( cell->GetStartX(), cell->GetEndY() );
if( !cell->GetTextAngle().IsHorizontal() )
botLeft = VECTOR2I( cell->GetEndX(), cell->GetStartY() );
if( cell->GetColSpan() > 0 && cell->GetRowSpan() > 0 )
{
aPlotter->MoveTo( VECTOR2I( cell->GetStartX(), cell->GetEndY() ) );
aPlotter->MoveTo( botLeft );
aPlotter->FinishTo( VECTOR2I( cell->GetEndX(), cell->GetEndY() ) );
}
}

3
eeschema/sch_tablecell.cpp

@ -98,8 +98,9 @@ wxString SCH_TABLECELL::GetAddr() const
void SCH_TABLECELL::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS& aPlotOpts,
int aUnit, int aBodyStyle, const VECTOR2I& aOffset, bool aDimmed )
{
const int cell_body_style = -1; // flage to disable box ouline plotting
if( m_colSpan >= 1 && m_rowSpan >= 1 )
SCH_TEXTBOX::Plot( aPlotter, aBackground, aPlotOpts, aUnit, aBodyStyle, aOffset, aDimmed );
SCH_TEXTBOX::Plot( aPlotter, aBackground, aPlotOpts, aUnit, cell_body_style, aOffset, aDimmed );
}

3
eeschema/sch_textbox.cpp

@ -388,7 +388,8 @@ void SCH_TEXTBOX::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS
COLOR4D bg = renderSettings->GetBackgroundColor();
LINE_STYLE lineStyle = GetStroke().GetLineStyle();
if( penWidth > 0 )
// Do not plot border for SCH_TABLECELL_T: borders are plotted separately.
if( penWidth > 0 && Type() != SCH_TABLECELL_T )
{
if( !aPlotter->GetColorMode() || color == COLOR4D::UNSPECIFIED )
color = renderSettings->GetLayerColor( m_layer );

Loading…
Cancel
Save