Prevent dxf imports of text from processing NaN coordinates

This commit is contained in:
Mark Roszko 2020-12-05 01:55:39 +00:00
parent 789284f519
commit dde87b2f45
1 changed files with 3 additions and 1 deletions

View File

@ -33,6 +33,7 @@
#include <wx/arrstr.h>
#include <wx/regex.h>
#include <cmath> // isnan
#include <trigo.h>
#include <macros.h>
#include <class_board.h>
@ -399,7 +400,8 @@ void DXF_IMPORT_PLUGIN::addText( const DL_TextData& aData )
return;
VECTOR2D refPoint( mapX( aData.ipx ), mapY( aData.ipy ) );
VECTOR2D secPoint( mapX( aData.apx ), mapY( aData.apy ) );
VECTOR2D secPoint( mapX( std::isnan( aData.apx ) ? 0 : aData.apx ),
mapY( std::isnan( aData.apy ) ? 0 : aData.apy ) );
if( aData.vJustification != 0 || aData.hJustification != 0 || aData.hJustification == 4 )
{