Browse Source

SCH_TABLE and PCB_TABLE: fix incorrect plot of tables rotated 90 or -90 deg.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19985
9.0
jean-pierre charras 11 months ago
parent
commit
276029ee03
  1. 21
      eeschema/sch_table.cpp
  2. 12
      pcbnew/plot_brditems_plotter.cpp

21
eeschema/sch_table.cpp

@ -546,16 +546,29 @@ void SCH_TABLE::Plot( PLOTTER* aPlotter, bool aBackground, const SCH_PLOT_OPTS&
if( GetBorderStroke().GetWidth() >= 0 )
{
setupStroke( GetBorderStroke() );
SCH_TABLECELL* cell = GetCell( 0, 0 );
if( StrokeHeader() )
{
SCH_TABLECELL* cell = GetCell( 0, 0 );
aPlotter->MoveTo( VECTOR2I( pos.x, cell->GetEndY() ) );
aPlotter->FinishTo( VECTOR2I( end.x, cell->GetEndY() ) );
}
if( !cell->GetTextAngle().IsHorizontal() )
{
aPlotter->MoveTo( VECTOR2I( cell->GetEndX(), pos.y ) );
aPlotter->FinishTo( VECTOR2I( cell->GetEndX(), cell->GetEndY() ) );
}
else
{
aPlotter->MoveTo( VECTOR2I( pos.x, cell->GetEndY() ) );
aPlotter->FinishTo( VECTOR2I( end.x, cell->GetEndY() ) );
}
}
if( StrokeExternal() )
{
RotatePoint( pos, GetPosition(), cell->GetTextAngle() );
RotatePoint( end, GetPosition(), cell->GetTextAngle() );
aPlotter->Rect( pos, end, FILL_T::NO_FILL, lineWidth );
}
}
}

12
pcbnew/plot_brditems_plotter.cpp

@ -1189,15 +1189,23 @@ void BRDITEMS_PLOTTER::PlotTableBorders( const PCB_TABLE* aTable )
if( aTable->GetBorderStroke().GetWidth() >= 0 )
{
setupStroke( aTable->GetBorderStroke() );
PCB_TABLECELL* cell = aTable->GetCell( 0, 0 );
if( aTable->StrokeHeader() )
{
PCB_TABLECELL* cell = aTable->GetCell( 0, 0 );
strokeLine( VECTOR2I( pos.x, cell->GetEndY() ), VECTOR2I( end.x, cell->GetEndY() ) );
if( !cell->GetTextAngle().IsHorizontal() )
strokeLine( VECTOR2I( cell->GetEndX(), pos.y ), VECTOR2I( cell->GetEndX(), cell->GetEndY() ) );
else
strokeLine( VECTOR2I( pos.x, cell->GetEndY() ), VECTOR2I( end.x, cell->GetEndY() ) );
}
if( aTable->StrokeExternal() )
{
RotatePoint( pos, aTable->GetPosition(), cell->GetTextAngle() );
RotatePoint( end, aTable->GetPosition(), cell->GetTextAngle() );
strokeRect( pos, end );
}
}
}

Loading…
Cancel
Save