Index: trunk/src/obj_text.c =================================================================== --- trunk/src/obj_text.c (revision 19588) +++ trunk/src/obj_text.c (revision 19589) @@ -666,6 +666,21 @@ pcb_text_bbox(pcb_font(PCB, Text->fid, 1), Text); } +/* rotates a text; only the bounding box is rotated, + text rotation itself is done by the drawing routines */ +void pcb_text_rotate(pcb_text_t *Text, pcb_coord_t X, pcb_coord_t Y, double cosa, double sina, double rotdeg) +{ + pcb_rotate(&Text->X, &Text->Y, X, Y, cosa, sina); + Text->rot += rotdeg; + if (Text->rot > 360.0) + Text->rot -= 360.0; + else if (Text->rot < 0.0) + Text->rot += 360.0; + + /* can't optimize with box rotation because of closed boxes */ + pcb_text_bbox(pcb_font(PCB, Text->fid, 1), Text); +} + /* rotates a text object and redraws it */ void *pcb_textop_rotate90(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_text_t *Text) { Index: trunk/src/obj_text.h =================================================================== --- trunk/src/obj_text.h (revision 19588) +++ trunk/src/obj_text.h (revision 19589) @@ -64,6 +64,7 @@ void pcb_text_bbox(pcb_font_t *FontPtr, pcb_text_t *Text); void pcb_text_rotate90(pcb_text_t *Text, pcb_coord_t X, pcb_coord_t Y, unsigned Number); +void pcb_text_rotate(pcb_text_t *Text, pcb_coord_t X, pcb_coord_t Y, double cosa, double sina, double rotdeg); void pcb_text_flip_side(pcb_layer_t *layer, pcb_text_t *text, pcb_coord_t y_offs); void pcb_text_mirror_coords(pcb_layer_t *layer, pcb_text_t *text, pcb_coord_t y_offs); /* mirror the coords but do not mirror the text itself (no on-solder) */ void pcb_text_set_font(pcb_layer_t *layer, pcb_text_t *text, pcb_font_id_t fid);