Fixed a crash when GRLineArray is called with an empty vector.

This commit is contained in:
Maciej Suminski 2016-05-26 17:14:08 +02:00
parent 8c8a1238f1
commit 25d526cbc6
1 changed files with 4 additions and 1 deletions

View File

@ -428,10 +428,13 @@ void GRMixedLine( EDA_RECT* ClipBox, wxDC* DC, int x1, int y1, int x2, int y2,
void GRLineArray( EDA_RECT* aClipBox, wxDC* aDC, std::vector<wxPoint>& aLines, void GRLineArray( EDA_RECT* aClipBox, wxDC* aDC, std::vector<wxPoint>& aLines,
int aWidth, EDA_COLOR_T aColor ) int aWidth, EDA_COLOR_T aColor )
{ {
if( aLines.empty() )
return;
GRSetColorPen( aDC, aColor, aWidth ); GRSetColorPen( aDC, aColor, aWidth );
if( aClipBox ) if( aClipBox )
aClipBox->Inflate(aWidth/2); aClipBox->Inflate( aWidth / 2 );
#if defined( __WXMAC__ ) && defined( USE_WX_GRAPHICS_CONTEXT ) #if defined( __WXMAC__ ) && defined( USE_WX_GRAPHICS_CONTEXT )
wxGCDC *gcdc = wxDynamicCast( aDC, wxGCDC ); wxGCDC *gcdc = wxDynamicCast( aDC, wxGCDC );