4 * \brief Functions used to change the mirror flag of an object.
6 * An undo operation is not implemented because it's easy to
11 * <h1><b>Copyright.</b></h1>\n
13 * PCB, interactive printed circuit board design
15 * Copyright (C) 1994,1995,1996 Thomas Nau
17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by
19 * the Free Software Foundation; either version 2 of the License, or
20 * (at your option) any later version.
22 * This program is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
27 * You should have received a copy of the GNU General Public License
28 * along with this program; if not, write to the Free Software
29 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
31 * Contact addresses for paper mail and Email:
33 * Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany
35 * Thomas.Nau@rz.uni-ulm.de
55 #ifdef HAVE_LIBDMALLOC
60 * \brief Mirrors the coordinates of an element.
62 * An additional offset is passed.
65 MirrorElementCoordinates (DataType
*Data
, ElementType
*Element
,
68 r_delete_element (Data
, Element
);
69 ELEMENTLINE_LOOP (Element
);
71 line
->Point1
.X
= SWAP_X (line
->Point1
.X
);
72 line
->Point1
.Y
= SWAP_Y (line
->Point1
.Y
) + yoff
;
73 line
->Point2
.X
= SWAP_X (line
->Point2
.X
);
74 line
->Point2
.Y
= SWAP_Y (line
->Point2
.Y
) + yoff
;
79 RestoreToPolygon (Data
, PIN_TYPE
, Element
, pin
);
80 pin
->X
= SWAP_X (pin
->X
);
81 pin
->Y
= SWAP_Y (pin
->Y
) + yoff
;
86 RestoreToPolygon (Data
, PAD_TYPE
, Element
, pad
);
87 pad
->Point1
.X
= SWAP_X (pad
->Point1
.X
);
88 pad
->Point1
.Y
= SWAP_Y (pad
->Point1
.Y
) + yoff
;
89 pad
->Point2
.X
= SWAP_X (pad
->Point2
.X
);
90 pad
->Point2
.Y
= SWAP_Y (pad
->Point2
.Y
) + yoff
;
91 TOGGLE_FLAG (ONSOLDERFLAG
, pad
);
96 arc
->X
= SWAP_X (arc
->X
);
97 arc
->Y
= SWAP_Y (arc
->Y
) + yoff
;
98 arc
->StartAngle
= SWAP_ANGLE (arc
->StartAngle
);
99 arc
->Delta
= SWAP_DELTA (arc
->Delta
);
102 ELEMENTTEXT_LOOP (Element
);
104 text
->X
= SWAP_X (text
->X
);
105 text
->Y
= SWAP_Y (text
->Y
) + yoff
;
106 TOGGLE_FLAG (ONSOLDERFLAG
, text
);
109 Element
->MarkX
= SWAP_X (Element
->MarkX
);
110 Element
->MarkY
= SWAP_Y (Element
->MarkY
) + yoff
;
112 /* now toggle the solder-side flag */
113 TOGGLE_FLAG (ONSOLDERFLAG
, Element
);
114 /* this inserts all of the rtree data too */
115 SetElementBoundingBox (Data
, Element
, &PCB
->Font
);
116 ClearFromPolygon (Data
, ELEMENT_TYPE
, Element
, Element
);