Index: trunk/src/board.c =================================================================== --- trunk/src/board.c (revision 4849) +++ trunk/src/board.c (revision 4850) @@ -223,3 +223,24 @@ hid_action("PCBChanged"); return (pcb_true); } + +void pcb_board_resize(pcb_coord_t Width, pcb_coord_t Height) +{ + PCB->MaxWidth = Width; + PCB->MaxHeight = Height; + + /* crosshair range is different if pastebuffer-mode + * is enabled + */ + if (conf_core.editor.mode == PCB_MODE_PASTE_BUFFER) + SetCrosshairRange(PCB_PASTEBUFFER->X - PCB_PASTEBUFFER->BoundingBox.X1, + PCB_PASTEBUFFER->Y - PCB_PASTEBUFFER->BoundingBox.Y1, + MAX(0, + Width - (PCB_PASTEBUFFER->BoundingBox.X2 - + PCB_PASTEBUFFER->X)), MAX(0, Height - (PCB_PASTEBUFFER->BoundingBox.Y2 - PCB_PASTEBUFFER->Y))); + else + SetCrosshairRange(0, 0, Width, Height); + + if (gui != NULL) + hid_action("PCBChanged"); +} Index: trunk/src/board.h =================================================================== --- trunk/src/board.h (revision 4849) +++ trunk/src/board.h (revision 4850) @@ -141,5 +141,9 @@ /* changes the name of a layout; Name is allocated by the caller (no strdup() is made) */ pcb_bool pcb_board_change_name(char *Name); +/* changes the maximum size of a layout, notifies the GUI + * and adjusts the cursor confinement box */ +void pcb_board_resize(pcb_coord_t Width, pcb_coord_t Height); + #endif Index: trunk/src/change.c =================================================================== --- trunk/src/change.c (revision 4849) +++ trunk/src/change.c (revision 4850) @@ -1227,30 +1227,3 @@ } return (NULL); } - -/* --------------------------------------------------------------------------- - * changes the maximum size of a layout - * adjusts the scrollbars - * releases the saved pixmap if necessary - * and adjusts the cursor confinement box - */ -void pcb_board_resize(pcb_coord_t Width, pcb_coord_t Height) -{ - PCB->MaxWidth = Width; - PCB->MaxHeight = Height; - - /* crosshair range is different if pastebuffer-mode - * is enabled - */ - if (conf_core.editor.mode == PCB_MODE_PASTE_BUFFER) - SetCrosshairRange(PCB_PASTEBUFFER->X - PCB_PASTEBUFFER->BoundingBox.X1, - PCB_PASTEBUFFER->Y - PCB_PASTEBUFFER->BoundingBox.Y1, - MAX(0, - Width - (PCB_PASTEBUFFER->BoundingBox.X2 - - PCB_PASTEBUFFER->X)), MAX(0, Height - (PCB_PASTEBUFFER->BoundingBox.Y2 - PCB_PASTEBUFFER->Y))); - else - SetCrosshairRange(0, 0, Width, Height); - - if (gui != NULL) - hid_action("PCBChanged"); -} Index: trunk/src/change.h =================================================================== --- trunk/src/change.h (revision 4849) +++ trunk/src/change.h (revision 4850) @@ -101,7 +101,6 @@ pcb_bool pcb_clr_obj_octagon(int, void *, void *, void *); void *pcb_chg_obj_name(int, void *, void *, void *, char *); void *pcb_chg_obj_name_query(int, void *, void *, void *, int); -void pcb_board_resize(pcb_coord_t, pcb_coord_t); void *pcb_chg_obj_pinnum(int Type, void *Ptr1, void *Ptr2, void *Ptr3, char *Name); pcb_bool pcb_chg_obj_radius(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int is_x, pcb_coord_t r, pcb_bool absolute); pcb_bool pcb_chg_obj_angle(int Type, void *Ptr1, void *Ptr2, void *Ptr3, int is_start, pcb_angle_t a, pcb_bool absolute);