PDF plotting: support bitmaps with transparency.
Fixes https://gitlab.com/kicad/code/kicad/-/issues/5979
This commit is contained in:
@@ -85,9 +85,28 @@ void PlotDrawingSheet( PLOTTER* plotter, const PROJECT* aProject, const TITLE_BL
|
||||
|
||||
drawList.BuildDrawItemsList( aPageInfo, aTitleBlock );
|
||||
|
||||
// Draw item list
|
||||
// Draw bitmaps first
|
||||
for( DS_DRAW_ITEM_BASE* item = drawList.GetFirst(); item; item = drawList.GetNext() )
|
||||
{
|
||||
if( item->Type() == WSG_BITMAP_T )
|
||||
{
|
||||
DS_DRAW_ITEM_BITMAP* drawItem = (DS_DRAW_ITEM_BITMAP*) item;
|
||||
DS_DATA_ITEM_BITMAP* bitmap = (DS_DATA_ITEM_BITMAP*) drawItem->GetPeer();
|
||||
|
||||
if( bitmap->m_ImageBitmap == nullptr )
|
||||
continue;
|
||||
|
||||
bitmap->m_ImageBitmap->PlotImage( plotter, drawItem->GetPosition(), plotColor,
|
||||
PLOTTER::USE_DEFAULT_LINE_WIDTH );
|
||||
}
|
||||
}
|
||||
|
||||
// Draw other items
|
||||
for( DS_DRAW_ITEM_BASE* item = drawList.GetFirst(); item; item = drawList.GetNext() )
|
||||
{
|
||||
if( item->Type() == WSG_BITMAP_T )
|
||||
continue;
|
||||
|
||||
plotter->SetColor( plotColor );
|
||||
plotter->SetCurrentLineWidth( PLOTTER::USE_DEFAULT_LINE_WIDTH );
|
||||
|
||||
@@ -157,19 +176,6 @@ void PlotDrawingSheet( PLOTTER* plotter, const PROJECT* aProject, const TITLE_BL
|
||||
}
|
||||
break;
|
||||
|
||||
case WSG_BITMAP_T:
|
||||
{
|
||||
DS_DRAW_ITEM_BITMAP* drawItem = (DS_DRAW_ITEM_BITMAP*) item;
|
||||
DS_DATA_ITEM_BITMAP* bitmap = (DS_DATA_ITEM_BITMAP*) drawItem->GetPeer();
|
||||
|
||||
if( bitmap->m_ImageBitmap == nullptr )
|
||||
break;
|
||||
|
||||
bitmap->m_ImageBitmap->PlotImage( plotter, drawItem->GetPosition(), plotColor,
|
||||
PLOTTER::USE_DEFAULT_LINE_WIDTH );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
wxFAIL_MSG( "PlotDrawingSheet(): Unknown drawing sheet item." );
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user