Fixed RS274X image rotation parsing.
If the image was being rotated by a valid amount but not 270 degrees due to the if statements it would already report that there was an invalid value. Also due to the strnicmp only checking the first 2 characters which was valid for 0* but not the rest of the numbers, some values would be able to work that shouldn't
This commit is contained in:
parent
e2972c5fff
commit
f88140c95d
|
@ -434,11 +434,11 @@ bool GERBER_IMAGE::ExecuteRS274XCommand( int command,
|
||||||
case IMAGE_ROTATION: // command IR0* or IR90* or IR180* or IR270*
|
case IMAGE_ROTATION: // command IR0* or IR90* or IR180* or IR270*
|
||||||
if( strnicmp( text, "0*", 2 ) == 0 )
|
if( strnicmp( text, "0*", 2 ) == 0 )
|
||||||
m_ImageRotation = 0;
|
m_ImageRotation = 0;
|
||||||
if( strnicmp( text, "90*", 2 ) == 0 )
|
else if( strnicmp( text, "90*", 3 ) == 0 )
|
||||||
m_ImageRotation = 90;
|
m_ImageRotation = 90;
|
||||||
if( strnicmp( text, "180*", 2 ) == 0 )
|
else if( strnicmp( text, "180*", 4 ) == 0 )
|
||||||
m_ImageRotation = 180;
|
m_ImageRotation = 180;
|
||||||
if( strnicmp( text, "270*", 2 ) == 0 )
|
else if( strnicmp( text, "270*", 4 ) == 0 )
|
||||||
m_ImageRotation = 270;
|
m_ImageRotation = 270;
|
||||||
else
|
else
|
||||||
ReportMessage( _( "RS274X: Command \"IR\" rotation value not allowed" ) );
|
ReportMessage( _( "RS274X: Command \"IR\" rotation value not allowed" ) );
|
||||||
|
|
Loading…
Reference in New Issue