7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-21 00:21:25 +00:00

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
This commit is contained in:
jean-pierre charras 2025-01-13 11:04:16 +01:00
parent d7f89c6576
commit af366a78b3

View File

@ -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 );
}