Browse Source

GerbView: incorrect handling of polygon primitive: broken parameters rotation and drill size.

Fixes: lp:1778459
https://bugs.launchpad.net/kicad/+bug/1778459
pull/17/head
jean-pierre charras 7 years ago
parent
commit
ef38a198d1
  1. 8
      gerbview/dcode.cpp
  2. 2
      gerbview/rs274x.cpp

8
gerbview/dcode.cpp

@ -407,12 +407,10 @@ void D_CODE::ConvertShapeToPolygon()
addHoleToPolygon( &m_Polygon, m_DrillShape, m_Drill, initialpos );
if( m_Rotation ) // vertical oval, rotate polygon.
if( m_Rotation ) // rotate polygonal shape:
{
int angle = KiROUND( m_Rotation * 10 );
for( auto it = m_Polygon.Iterate( 0 ); it; ++it )
it->Rotate( -angle );
double angle = m_Rotation * M_PI / 180;
m_Polygon.Rotate( angle, VECTOR2I( 0, 0 ) );
}
break;

2
gerbview/rs274x.cpp

@ -824,7 +824,7 @@ bool GERBER_FILE_IMAGE::ExecuteRS274XCommand( int aCommand, char* aBuff,
{
aText++;
dcode->m_Drill.x = KiROUND( ReadDouble( aText ) * conv_scale );
dcode->m_Drill.y = dcode->m_Drill.x =
dcode->m_Drill.y = dcode->m_Drill.x;
dcode->m_DrillShape = APT_DEF_ROUND_HOLE;
}

Loading…
Cancel
Save