Commit 00fafe7d authored by jean-pierre charras's avatar jean-pierre charras

eeschema, libedit l fix a bug in lib_arc.cpp which creates incorrect arc start...

eeschema, libedit l fix a bug in lib_arc.cpp which creates incorrect arc start and arc end parameters after rotation or mirror.
the Bug #1121079 is due to this bug, but Bug #1121079 itself cannot be fixed because this is the data inside the lib which is broken.
parent 93a5b4a0
......@@ -293,6 +293,19 @@ void LIB_ARC::MirrorHorizontal( const wxPoint& aCenter )
m_ArcEnd.x *= -1;
m_ArcEnd.x += aCenter.x;
EXCHG( m_ArcStart, m_ArcEnd );
EXCHG( m_t1, m_t2 );
m_t1 = 1800 - m_t1;
m_t2 = 1800 - m_t2;
if( m_t1 > 3600 || m_t2 > 3600 )
{
m_t1 -= 3600;
m_t2 -= 3600;
}
else if( m_t1 < -3600 || m_t2 < -3600 )
{
m_t1 += 3600;
m_t2 += 3600;
}
}
void LIB_ARC::MirrorVertical( const wxPoint& aCenter )
......@@ -307,6 +320,19 @@ void LIB_ARC::MirrorVertical( const wxPoint& aCenter )
m_ArcEnd.y *= -1;
m_ArcEnd.y += aCenter.y;
EXCHG( m_ArcStart, m_ArcEnd );
EXCHG( m_t1, m_t2 );
m_t1 = - m_t1;
m_t2 = - m_t2;
if( m_t1 > 3600 || m_t2 > 3600 )
{
m_t1 -= 3600;
m_t2 -= 3600;
}
else if( m_t1 < -3600 || m_t2 < -3600 )
{
m_t1 += 3600;
m_t2 += 3600;
}
}
void LIB_ARC::Rotate( const wxPoint& aCenter, bool aRotateCCW )
......@@ -315,6 +341,18 @@ void LIB_ARC::Rotate( const wxPoint& aCenter, bool aRotateCCW )
RotatePoint( &m_Pos, aCenter, rot_angle );
RotatePoint( &m_ArcStart, aCenter, rot_angle );
RotatePoint( &m_ArcEnd, aCenter, rot_angle );
m_t1 -= rot_angle;
m_t2 -= rot_angle;
if( m_t1 > 3600 || m_t2 > 3600 )
{
m_t1 -= 3600;
m_t2 -= 3600;
}
else if( m_t1 < -3600 || m_t2 < -3600 )
{
m_t1 += 3600;
m_t2 += 3600;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment