Add checks against missing D-Codes in flashed Gerber items
Fixes: lp:1756710 * https://bugs.launchpad.net/kicad/+bug/1756710
This commit is contained in:
parent
aa0ae48dda
commit
4e76a18d5d
|
@ -320,37 +320,49 @@ const EDA_RECT GERBER_DRAW_ITEM::GetBoundingBox() const
|
|||
|
||||
case GBR_SPOT_CIRCLE:
|
||||
{
|
||||
int radius = code->m_Size.x >> 1;
|
||||
bbox.Inflate( radius, radius );
|
||||
if( code )
|
||||
{
|
||||
int radius = code->m_Size.x >> 1;
|
||||
bbox.Inflate( radius, radius );
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
case GBR_SPOT_RECT:
|
||||
{
|
||||
bbox.Inflate( code->m_Size.x / 2, code->m_Size.y / 2 );
|
||||
if( code )
|
||||
bbox.Inflate( code->m_Size.x / 2, code->m_Size.y / 2 );
|
||||
break;
|
||||
}
|
||||
|
||||
case GBR_SPOT_OVAL:
|
||||
{
|
||||
bbox.Inflate( code->m_Size.x, code->m_Size.y );
|
||||
if( code )
|
||||
bbox.Inflate( code->m_Size.x, code->m_Size.y );
|
||||
break;
|
||||
}
|
||||
|
||||
case GBR_SPOT_POLY:
|
||||
{
|
||||
if( code->m_Polygon.OutlineCount() == 0 )
|
||||
code->ConvertShapeToPolygon();
|
||||
if( code )
|
||||
{
|
||||
if( code->m_Polygon.OutlineCount() == 0 )
|
||||
code->ConvertShapeToPolygon();
|
||||
|
||||
bbox.Inflate( code->m_Polygon.BBox().GetWidth() / 2, code->m_Polygon.BBox().GetHeight() / 2 );
|
||||
bbox.Inflate( code->m_Polygon.BBox().GetWidth() / 2,
|
||||
code->m_Polygon.BBox().GetHeight() / 2 );
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GBR_SPOT_MACRO:
|
||||
{
|
||||
// Update the shape drawings and the bounding box coordiantes:
|
||||
code->GetMacro()->GetApertureMacroShape( this, m_Start );
|
||||
// now the bounding box is valid:
|
||||
bbox = code->GetMacro()->GetBoundingBox();
|
||||
if( code )
|
||||
{
|
||||
// Update the shape drawings and the bounding box coordiantes:
|
||||
code->GetMacro()->GetApertureMacroShape( this, m_Start );
|
||||
// now the bounding box is valid:
|
||||
bbox = code->GetMacro()->GetBoundingBox();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -406,6 +406,9 @@ void GERBVIEW_PAINTER::drawFlashedShape( GERBER_DRAW_ITEM* aItem, bool aFilled )
|
|||
|
||||
wxASSERT_MSG( code, wxT( "drawFlashedShape: Item has no D_CODE!" ) );
|
||||
|
||||
if( !code )
|
||||
return;
|
||||
|
||||
m_gal->SetIsFill( aFilled );
|
||||
m_gal->SetIsStroke( !aFilled );
|
||||
m_gal->SetLineWidth( m_gerbviewSettings.m_outlineWidth );
|
||||
|
|
Loading…
Reference in New Issue