Browse Source

Eeschema: fix correct background area size when plotting a sheet.

If a sheet is bigger than the page size selected in the plotter (PC, PDF , SVG)
(i.a a A3 sheet plotted scaled to A4 page) the background area size actually plotted
was to small.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19611
pcb_db
jean-pierre charras 11 months ago
parent
commit
af366a78b3
  1. 22
      eeschema/sch_plotter.cpp

22
eeschema/sch_plotter.cpp

@ -250,8 +250,12 @@ void SCH_PLOTTER::plotOneSheetPDF( PLOTTER* aPlotter, SCH_SCREEN* aScreen,
if( aPlotOpts.m_useBackgroundColor && aPlotter->GetColorMode() )
{
aPlotter->SetColor( aPlotter->RenderSettings()->GetBackgroundColor() );
VECTOR2I end( aPlotter->PageSettings().GetWidthIU( schIUScale.IU_PER_MILS ),
aPlotter->PageSettings().GetHeightIU( schIUScale.IU_PER_MILS ) );
// Use page size selected in schematic to know the schematic bg area
const PAGE_INFO& actualPage = aScreen->GetPageSettings(); // page size selected in schematic
VECTOR2I end( actualPage.GetWidthIU( schIUScale.IU_PER_MILS ),
actualPage.GetHeightIU( schIUScale.IU_PER_MILS ) );
aPlotter->Rect( VECTOR2I( 0, 0 ), end, FILL_T::FILLED_SHAPE, 1.0 );
}
@ -460,8 +464,11 @@ bool SCH_PLOTTER::plotOneSheetPS( const wxString& aFileName, SCH_SCREEN* aScreen
{
plotter->SetColor( plotter->RenderSettings()->GetLayerColor( LAYER_SCHEMATIC_BACKGROUND ) );
VECTOR2I end( plotter->PageSettings().GetWidthIU( schIUScale.IU_PER_MILS ),
plotter->PageSettings().GetHeightIU( schIUScale.IU_PER_MILS ) );
// Use page size selected in schematic to know the schematic bg area
const PAGE_INFO& actualPage = aScreen->GetPageSettings(); // page size selected in schematic
VECTOR2I end( actualPage.GetWidthIU( schIUScale.IU_PER_MILS ),
actualPage.GetHeightIU( schIUScale.IU_PER_MILS ) );
plotter->Rect( VECTOR2I( 0, 0 ), end, FILL_T::FILLED_SHAPE, 1.0 );
}
@ -635,8 +642,11 @@ bool SCH_PLOTTER::plotOneSheetSVG( const wxString& aFileName, SCH_SCREEN* aScree
if( aPlotOpts.m_useBackgroundColor && plotter->GetColorMode() )
{
plotter->SetColor( plotter->RenderSettings()->GetLayerColor( LAYER_SCHEMATIC_BACKGROUND ) );
VECTOR2I end( plotter->PageSettings().GetWidthIU( schIUScale.IU_PER_MILS ),
plotter->PageSettings().GetHeightIU( schIUScale.IU_PER_MILS ) );
// Use page size selected in schematic to know the schematic bg area
VECTOR2I end( actualPage.GetWidthIU( schIUScale.IU_PER_MILS ),
actualPage.GetHeightIU( schIUScale.IU_PER_MILS ) );
plotter->Rect( VECTOR2I( 0, 0 ), end, FILL_T::FILLED_SHAPE, 1.0 );
}

Loading…
Cancel
Save