Gerbview: fix a long standing issue: negative objects are now correctly printed.
This commit is contained in:
parent
7e6829e834
commit
f8d6dd1efd
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
|
* Copyright (C) 2009 Jean-Pierre Charras, jean-pierre.charras at wanadoo.fr
|
||||||
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
* Copyright (C) 2018 CERN
|
* Copyright (C) 2018 CERN
|
||||||
* Author: Maciej Suminski <maciej.suminski@cern.ch>
|
* Author: Maciej Suminski <maciej.suminski@cern.ch>
|
||||||
*
|
*
|
||||||
|
@ -70,6 +70,7 @@ BOARD_PRINTOUT::BOARD_PRINTOUT( const BOARD_PRINTOUT_SETTINGS& aParams,
|
||||||
m_settings( aParams )
|
m_settings( aParams )
|
||||||
{
|
{
|
||||||
m_view = aView;
|
m_view = aView;
|
||||||
|
m_gerbviewPrint = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -85,12 +86,12 @@ void BOARD_PRINTOUT::GetPageInfo( int* minPage, int* maxPage, int* selPageFrom,
|
||||||
|
|
||||||
void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPageCount )
|
void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPageCount )
|
||||||
{
|
{
|
||||||
auto dc = GetDC();
|
wxDC* dc = GetDC();
|
||||||
KIGFX::GAL_DISPLAY_OPTIONS options;
|
KIGFX::GAL_DISPLAY_OPTIONS options;
|
||||||
auto galPrint = KIGFX::GAL_PRINT::Create( options, dc );
|
std::unique_ptr<KIGFX::GAL_PRINT> galPrint = KIGFX::GAL_PRINT::Create( options, dc );
|
||||||
auto gal = galPrint->GetGAL();
|
KIGFX::GAL* gal = galPrint->GetGAL();
|
||||||
auto printCtx = galPrint->GetPrintCtx();
|
KIGFX::PRINT_CONTEXT* printCtx = galPrint->GetPrintCtx();
|
||||||
auto painter = getPainter( gal );
|
std::unique_ptr<KIGFX::PAINTER> painter = getPainter( gal );
|
||||||
std::unique_ptr<KIGFX::VIEW> view( m_view->DataReference() );
|
std::unique_ptr<KIGFX::VIEW> view( m_view->DataReference() );
|
||||||
|
|
||||||
// Target paper size
|
// Target paper size
|
||||||
|
@ -175,6 +176,11 @@ void BOARD_PRINTOUT::DrawPage( const wxString& aLayerName, int aPageNum, int aPa
|
||||||
gal->SetClearColor( dstSettings->GetBackgroundColor() );
|
gal->SetClearColor( dstSettings->GetBackgroundColor() );
|
||||||
gal->ClearScreen();
|
gal->ClearScreen();
|
||||||
|
|
||||||
|
if( m_gerbviewPrint )
|
||||||
|
// Mandatory in Gerbview to use the same order for printing as for screen redraw
|
||||||
|
// due to negative objects that need a specific order
|
||||||
|
view->UseDrawPriority( true );
|
||||||
|
|
||||||
{
|
{
|
||||||
KIGFX::GAL_DRAWING_CONTEXT ctx( gal );
|
KIGFX::GAL_DRAWING_CONTEXT ctx( gal );
|
||||||
view->Redraw();
|
view->Redraw();
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
* Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||||
* Copyright (C) 1992-2016 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -38,6 +38,7 @@ GERBVIEW_PRINTOUT::GERBVIEW_PRINTOUT( GBR_LAYOUT* aLayout, const BOARD_PRINTOUT_
|
||||||
BOARD_PRINTOUT( aParams, aView, aTitle )
|
BOARD_PRINTOUT( aParams, aView, aTitle )
|
||||||
{
|
{
|
||||||
m_layout = aLayout;
|
m_layout = aLayout;
|
||||||
|
m_gerbviewPrint = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr
|
* Copyright (C) 2009 Jean-Pierre Charras, jean-pierre.charras at wanadoo.fr
|
||||||
* Copyright (C) 1992-2021 KiCad Developers, see AUTHORS.txt for contributors.
|
* Copyright (C) 1992-2022 KiCad Developers, see AUTHORS.txt for contributors.
|
||||||
* Copyright (C) 2018 CERN
|
* Copyright (C) 2018 CERN
|
||||||
* Author: Maciej Suminski <maciej.suminski@cern.ch>
|
* Author: Maciej Suminski <maciej.suminski@cern.ch>
|
||||||
*
|
*
|
||||||
|
@ -119,6 +119,9 @@ protected:
|
||||||
|
|
||||||
///< Printout parameters
|
///< Printout parameters
|
||||||
BOARD_PRINTOUT_SETTINGS m_settings;
|
BOARD_PRINTOUT_SETTINGS m_settings;
|
||||||
|
|
||||||
|
/// True if the caller is Gerbview, false for Pcbnew
|
||||||
|
bool m_gerbviewPrint;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // BOARD_PRINTOUT_H
|
#endif // BOARD_PRINTOUT_H
|
||||||
|
|
Loading…
Reference in New Issue