Index: trunk/src/Makefile.in =================================================================== --- trunk/src/Makefile.in (revision 29277) +++ trunk/src/Makefile.in (revision 29278) @@ -606,7 +606,7 @@ # rndlib: corner case: some headers are not derived from the objects sub /local/pcb/HDRS_HIDLIB {$(LIBRND)/core/hid_dlg.h } {} sub /local/pcb/HDRS_HIDLIB {polygon1.h } {} -append /local/pcb/HDRS_HIDLIB {$(LIBRND)/core/hid.h polyarea.h $(LIBRND)/core/global_typedefs.h $(LIBRND)/core/globalconst.h math_helper.h $(LIBRND)/core/buildin.hidlib.h $(LIBRND)/core/hid_inlines.h rotate.h $(LIBRND)/core/fptr_cast.h safe_fs_dir.h $(LIBRND)/core/compat_inc.h } +append /local/pcb/HDRS_HIDLIB {$(LIBRND)/core/hid.h polyarea.h $(LIBRND)/core/global_typedefs.h $(LIBRND)/core/globalconst.h math_helper.h $(LIBRND)/core/buildin.hidlib.h $(LIBRND)/core/hid_inlines.h $(LIBRND)/core/rotate.h $(LIBRND)/core/fptr_cast.h safe_fs_dir.h $(LIBRND)/core/compat_inc.h } gsub /local/pcb/HDRS_3RDLIB {../src_3rd/liblihata/dom_[^ ]*.h } {} gsub /local/pcb/HDRS_3RDLIB {../src_3rd/liblihata/tree_[^ ]*.h } {} gsub /local/pcb/HDRS_3RDLIB {../src_3rd/libfungw/fungw_ptr.h ../src_3rd/libfungw/fungw_debug.h ../src_3rd/libfungw/fungw_call.h } {} Index: trunk/src/librnd/core/box.c =================================================================== --- trunk/src/librnd/core/box.c (revision 29277) +++ trunk/src/librnd/core/box.c (revision 29278) @@ -30,7 +30,7 @@ #include "config.h" #include -#include "rotate.h" +#include #include void pcb_box_rotate90(pcb_box_t *Box, pcb_coord_t X, pcb_coord_t Y, unsigned Number) Index: trunk/src/librnd/core/rotate.h =================================================================== --- trunk/src/librnd/core/rotate.h (nonexistent) +++ trunk/src/librnd/core/rotate.h (revision 29278) @@ -0,0 +1,67 @@ +/* + * COPYRIGHT + * + * pcb-rnd, interactive printed circuit board design + * (this file is based on PCB, interactive printed circuit board design) + * Copyright (C) 1994,1995,1996 Thomas Nau + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Contact: + * Project page: http://repo.hu/projects/pcb-rnd + * lead developer: http://repo.hu/projects/pcb-rnd/contact.html + * mailing list: pcb-rnd (at) list.repo.hu (send "subscribe") + * + */ + +#ifndef RND_ROTATE_H +#define RND_ROTATE_H + +#include "config.h" +#include +#include + +/*** Transformation macros ***/ +#define PCB_COORD_ROTATE90(x,y,x0,y0,n) \ + do { \ + pcb_coord_t dx = (x)-(x0), \ + dy = (y)-(y0); \ + \ + switch(n & 0x03) \ + { \ + case 1: (x)=(x0)+dy; (y)=(y0)-dx; \ + break; \ + case 2: (x)=(x0)-dx; (y)=(y0)-dy; \ + break; \ + case 3: (x)=(x0)-dy; (y)=(y0)+dx; \ + break; \ + default: break; \ + } \ + } while(0) + +PCB_INLINE void pcb_rotate(pcb_coord_t * x, pcb_coord_t * y, pcb_coord_t cx, pcb_coord_t cy, double cosa, double sina) +{ + double nx, ny; + pcb_coord_t px = *x - cx; + pcb_coord_t py = *y - cy; + + nx = pcb_round(px * cosa + py * sina + cx); + ny = pcb_round(py * cosa - px * sina + cy); + + *x = nx; + *y = ny; +} + +#endif Index: trunk/src/rotate.h =================================================================== --- trunk/src/rotate.h (revision 29277) +++ trunk/src/rotate.h (revision 29278) @@ -29,28 +29,8 @@ #ifndef PCB_ROTATE_H #define PCB_ROTATE_H -#include "config.h" -#include -#include +#include -/*** Transformation macros ***/ -#define PCB_COORD_ROTATE90(x,y,x0,y0,n) \ - do { \ - pcb_coord_t dx = (x)-(x0), \ - dy = (y)-(y0); \ - \ - switch(n & 0x03) \ - { \ - case 1: (x)=(x0)+dy; (y)=(y0)-dx; \ - break; \ - case 2: (x)=(x0)-dx; (y)=(y0)-dy; \ - break; \ - case 3: (x)=(x0)-dy; (y)=(y0)+dx; \ - break; \ - default: break; \ - } \ - } while(0) - #define PCB_ROTATE_TYPES (PCB_OBJ_PSTK | PCB_OBJ_SUBC | PCB_OBJ_TEXT | PCB_OBJ_ARC | PCB_OBJ_LINE_POINT | PCB_OBJ_LINE | PCB_OBJ_POLY | PCB_OBJ_FLOATER) /* rotates an object passed; pcb is the parent board or associated board (in @@ -64,17 +44,4 @@ void pcb_screen_obj_rotate(pcb_board_t *pcb, pcb_coord_t X, pcb_coord_t Y, pcb_angle_t angle); void pcb_point_rotate90(pcb_point_t *Point, pcb_coord_t X, pcb_coord_t Y, unsigned Number); -PCB_INLINE void pcb_rotate(pcb_coord_t * x, pcb_coord_t * y, pcb_coord_t cx, pcb_coord_t cy, double cosa, double sina) -{ - double nx, ny; - pcb_coord_t px = *x - cx; - pcb_coord_t py = *y - cy; - - nx = pcb_round(px * cosa + py * sina + cx); - ny = pcb_round(py * cosa - px * sina + cy); - - *x = nx; - *y = ny; -} - #endif