Index: trunk/doc-rnd/hacking/renames =================================================================== --- trunk/doc-rnd/hacking/renames (revision 4910) +++ trunk/doc-rnd/hacking/renames (revision 4911) @@ -454,3 +454,6 @@ TO_RADIANS -> PCB_TO_RADIANS MAKEMIN -> PCB_MAKE_MIN MAKEMAX -> PCB_MAKE_MAX +SGNZ -> PCB_SGNZ +SWAP_SIGN_X -> PCB_SWAP_SIGN_X +SWAP_SIGN_Y -> PCB_SWAP_SIGN_Y Index: trunk/src/action_helper.c =================================================================== --- trunk/src/action_helper.c (revision 4910) +++ trunk/src/action_helper.c (revision 4911) @@ -631,24 +631,24 @@ wx = Note.X - Crosshair.AttachedBox.Point1.X; wy = Note.Y - Crosshair.AttachedBox.Point1.Y; if (PCB_XOR(Crosshair.AttachedBox.otherway, coord_abs(wy) > coord_abs(wx))) { - Crosshair.AttachedBox.Point2.X = Crosshair.AttachedBox.Point1.X + coord_abs(wy) * SGNZ(wx); + Crosshair.AttachedBox.Point2.X = Crosshair.AttachedBox.Point1.X + coord_abs(wy) * PCB_SGNZ(wx); sa = (wx >= 0) ? 0 : 180; #ifdef ARC45 if (abs(wy) / 2 >= abs(wx)) - dir = (SGNZ(wx) == SGNZ(wy)) ? 45 : -45; + dir = (PCB_SGNZ(wx) == PCB_SGNZ(wy)) ? 45 : -45; else #endif - dir = (SGNZ(wx) == SGNZ(wy)) ? 90 : -90; + dir = (PCB_SGNZ(wx) == PCB_SGNZ(wy)) ? 90 : -90; } else { - Crosshair.AttachedBox.Point2.Y = Crosshair.AttachedBox.Point1.Y + coord_abs(wx) * SGNZ(wy); + Crosshair.AttachedBox.Point2.Y = Crosshair.AttachedBox.Point1.Y + coord_abs(wx) * PCB_SGNZ(wy); sa = (wy >= 0) ? -90 : 90; #ifdef ARC45 if (abs(wx) / 2 >= abs(wy)) - dir = (SGNZ(wx) == SGNZ(wy)) ? -45 : 45; + dir = (PCB_SGNZ(wx) == PCB_SGNZ(wy)) ? -45 : 45; else #endif - dir = (SGNZ(wx) == SGNZ(wy)) ? -90 : 90; + dir = (PCB_SGNZ(wx) == PCB_SGNZ(wy)) ? -90 : 90; wy = wx; } if (coord_abs(wy) > 0 && (arc = CreateNewArcOnLayer(CURRENT, Index: trunk/src/board.h =================================================================== --- trunk/src/board.h (revision 4910) +++ trunk/src/board.h (revision 4911) @@ -132,8 +132,8 @@ within_area. */ void pcb_board_count_holes(int *plated, int *unplated, const pcb_box_t * within_area); -#define PCB_SWAP_X(x) (SWAP_SIGN_X(x)) -#define PCB_SWAP_Y(y) (PCB->MaxHeight +SWAP_SIGN_Y(y)) +#define PCB_SWAP_X(x) (PCB_SWAP_SIGN_X(x)) +#define PCB_SWAP_Y(y) (PCB->MaxHeight +PCB_SWAP_SIGN_Y(y)) const char *pcb_board_get_filename(void); const char *pcb_board_get_name(void); Index: trunk/src/crosshair.c =================================================================== --- trunk/src/crosshair.c (revision 4910) +++ trunk/src/crosshair.c (revision 4911) @@ -145,24 +145,24 @@ arc.X = Crosshair.AttachedBox.Point1.X; arc.Y = Crosshair.AttachedBox.Point1.Y; if (PCB_XOR(Crosshair.AttachedBox.otherway, coord_abs(wy) > coord_abs(wx))) { - arc.X = Crosshair.AttachedBox.Point1.X + coord_abs(wy) * SGNZ(wx); + arc.X = Crosshair.AttachedBox.Point1.X + coord_abs(wy) * PCB_SGNZ(wx); sa = (wx >= 0) ? 0 : 180; #ifdef ARC45 if (coord_abs(wy) >= 2 * coord_abs(wx)) - dir = (SGNZ(wx) == SGNZ(wy)) ? 45 : -45; + dir = (PCB_SGNZ(wx) == PCB_SGNZ(wy)) ? 45 : -45; else #endif - dir = (SGNZ(wx) == SGNZ(wy)) ? 90 : -90; + dir = (PCB_SGNZ(wx) == PCB_SGNZ(wy)) ? 90 : -90; } else { - arc.Y = Crosshair.AttachedBox.Point1.Y + coord_abs(wx) * SGNZ(wy); + arc.Y = Crosshair.AttachedBox.Point1.Y + coord_abs(wx) * PCB_SGNZ(wy); sa = (wy >= 0) ? -90 : 90; #ifdef ARC45 if (coord_abs(wx) >= 2 * coord_abs(wy)) - dir = (SGNZ(wx) == SGNZ(wy)) ? -45 : 45; + dir = (PCB_SGNZ(wx) == PCB_SGNZ(wy)) ? -45 : 45; else #endif - dir = (SGNZ(wx) == SGNZ(wy)) ? -90 : 90; + dir = (PCB_SGNZ(wx) == PCB_SGNZ(wy)) ? -90 : 90; wy = wx; } wy = coord_abs(wy); Index: trunk/src/math_helper.h =================================================================== --- trunk/src/math_helper.h (revision 4910) +++ trunk/src/math_helper.h (revision 4911) @@ -57,10 +57,10 @@ #ifndef SGN #define SGN(a) ((a) >0 ? 1 : ((a) == 0 ? 0 : -1)) #endif -#define SGNZ(a) ((a) >=0 ? 1 : -1) +#define PCB_SGNZ(a) ((a) >=0 ? 1 : -1) #define PCB_MAKE_MIN(a,b) if ((b) < (a)) (a) = (b) #define PCB_MAKE_MAX(a,b) if ((b) > (a)) (a) = (b) -#define SWAP_SIGN_X(x) (x) -#define SWAP_SIGN_Y(y) (-(y)) +#define PCB_SWAP_SIGN_X(x) (x) +#define PCB_SWAP_SIGN_Y(y) (-(y)) Index: trunk/src/obj_text.c =================================================================== --- trunk/src/obj_text.c (revision 4910) +++ trunk/src/obj_text.c (revision 4911) @@ -498,10 +498,10 @@ * side haven't been swapped yet, only their offset */ if (PCB_FLAG_TEST(PCB_FLAG_ONSOLDER, Text)) { - newline.Point1.X = SWAP_SIGN_X(newline.Point1.X); - newline.Point1.Y = SWAP_SIGN_Y(newline.Point1.Y); - newline.Point2.X = SWAP_SIGN_X(newline.Point2.X); - newline.Point2.Y = SWAP_SIGN_Y(newline.Point2.Y); + newline.Point1.X = PCB_SWAP_SIGN_X(newline.Point1.X); + newline.Point1.Y = PCB_SWAP_SIGN_Y(newline.Point1.Y); + newline.Point2.X = PCB_SWAP_SIGN_X(newline.Point2.X); + newline.Point2.Y = PCB_SWAP_SIGN_Y(newline.Point2.Y); } /* add offset and draw line */ newline.Point1.X += Text->X;