committed patch for arcs.

This commit is contained in:
charras 2009-05-10 15:43:41 +00:00
parent 1f7fc4940f
commit c7b99e1d8c
1 changed files with 17 additions and 15 deletions

View File

@ -288,7 +288,7 @@ static void fillLineTRACK( TRACK* aTrack,
static void fillArcTRACK( TRACK* aTrack, int Dcode_index, int aLayer, static void fillArcTRACK( TRACK* aTrack, int Dcode_index, int aLayer,
const wxPoint& aStart, const wxPoint& aEnd, const wxPoint& aStart, const wxPoint& aEnd,
const wxPoint& rel_center, int aWidth, const wxPoint& rel_center, int aWidth,
bool trigo_sens, bool multiquadrant, bool isDark ) bool clockwise, bool multiquadrant, bool isDark )
{ {
wxPoint center, delta; wxPoint center, delta;
@ -299,9 +299,9 @@ static void fillArcTRACK( TRACK* aTrack, int Dcode_index, int aLayer,
if( multiquadrant ) if( multiquadrant )
{ {
center.x = aStart.x + rel_center.x; center.x = aStart.x + rel_center.x;
center.y = aStart.y - rel_center.y; center.y = aStart.y + rel_center.y;
if( !trigo_sens ) if( clockwise )
{ {
aTrack->m_Start = aStart; aTrack->m_Start = aStart;
aTrack->m_End = aEnd; aTrack->m_End = aEnd;
@ -318,29 +318,31 @@ static void fillArcTRACK( TRACK* aTrack, int Dcode_index, int aLayer,
delta.x = aEnd.x - aStart.x; delta.x = aEnd.x - aStart.x;
delta.y = aEnd.y - aStart.y; delta.y = aEnd.y - aStart.y;
// il faut corriger de signe de rel_center.x et rel_center.y if( (delta.x >= 0) && (delta.y >= 0) )
// selon le quadrant ou on se trouve
if( (delta.x >= 0) && (delta.y >= 0) ) // 1er quadrant
{ {
center.x = -center.x; // Quadrant 2
} }
else if( (delta.x < 0) && (delta.y >= 0) ) // 2eme quadrant else if( (delta.x >= 0) && (delta.y < 0) )
{ {
center.x = -center.x; // Quadrant 1
center.y = -center.y; center.y = -center.y;
} }
else if( (delta.x < 0) && (delta.y < 0) ) // 3eme quadrant else if( (delta.x < 0) && (delta.y >= 0) )
{ {
center.y = -center.y; // Quadrant 4
center.x = -center.x;
} }
else // 4eme qadrant: les 2 coord sont >= 0! else
{ {
// Quadrant 3
center.x = -center.x;
center.y = -center.y;
} }
center.x += aStart.x; center.x += aStart.x;
center.y = aStart.y + center.y; center.y += aStart.y;
if( trigo_sens ) if( clockwise )
{ {
aTrack->m_Start = aStart; aTrack->m_Start = aStart;
aTrack->m_End = aEnd; aTrack->m_End = aEnd;