Index: trunk/src/obj_line.c =================================================================== --- trunk/src/obj_line.c (revision 5302) +++ trunk/src/obj_line.c (revision 5303) @@ -716,6 +716,34 @@ return (Line); } +/* rotates a line's */ +void *RotateLine(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line, pcb_point_t *Point) +{ + EraseLine(Line); + if (Layer) { + pcb_poly_restore_to_poly(PCB->Data, PCB_TYPE_LINE, Layer, Line); + pcb_r_delete_entry(Layer->line_tree, (pcb_box_t *) Line); + } + else + pcb_r_delete_entry(PCB->Data->rat_tree, (pcb_box_t *) Line); + + pcb_point_rotate90(&Line->Point1, ctx->rotate.center_x, ctx->rotate.center_y, ctx->rotate.number); + pcb_point_rotate90(&Line->Point2, ctx->rotate.center_x, ctx->rotate.center_y, ctx->rotate.number); + + pcb_line_bbox(Line); + if (Layer) { + pcb_r_insert_entry(Layer->line_tree, (pcb_box_t *) Line, 0); + pcb_poly_clear_from_poly(PCB->Data, PCB_TYPE_LINE, Layer, Line); + DrawLine(Layer, Line); + } + else { + pcb_r_insert_entry(PCB->Data->rat_tree, (pcb_box_t *) Line, 0); + DrawRat((pcb_rat_t *) Line); + } + pcb_draw(); + return (Line); +} + /* inserts a point into a line */ void *InsertPointIntoLine(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line) { Index: trunk/src/obj_line_op.h =================================================================== --- trunk/src/obj_line_op.h (revision 5302) +++ trunk/src/obj_line_op.h (revision 5303) @@ -46,6 +46,7 @@ void *RemoveLinePoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line, pcb_point_t *Point); void *RemoveLine_op(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line); void *RotateLinePoint(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line, pcb_point_t *Point); +void *RotateLine(pcb_opctx_t *ctx, pcb_layer_t *Layer, pcb_line_t *Line, pcb_point_t *Point); Index: trunk/src/rotate.c =================================================================== --- trunk/src/rotate.c (revision 5302) +++ trunk/src/rotate.c (revision 5303) @@ -53,7 +53,7 @@ * some local identifiers */ static pcb_opfunc_t Rotate90Functions = { - NULL, + RotateLine, RotateText, NULL, NULL, Index: trunk/src/rotate.h =================================================================== --- trunk/src/rotate.h (revision 5302) +++ trunk/src/rotate.h (revision 5303) @@ -52,7 +52,7 @@ } \ } while(0) -#define PCB_ROTATE_TYPES (PCB_TYPE_ELEMENT | PCB_TYPE_TEXT | PCB_TYPE_ELEMENT_NAME | PCB_TYPE_ARC | PCB_TYPE_LINE_POINT) +#define PCB_ROTATE_TYPES (PCB_TYPE_ELEMENT | PCB_TYPE_TEXT | PCB_TYPE_ELEMENT_NAME | PCB_TYPE_ARC | PCB_TYPE_LINE_POINT | PCB_TYPE_LINE) void *pcb_obj_rotate90(int, void *, void *, void *, pcb_coord_t, pcb_coord_t, unsigned); void pcb_screen_obj_rotate90(pcb_coord_t, pcb_coord_t, unsigned);