Index: src/sch-rnd/sheet.c =================================================================== --- src/sch-rnd/sheet.c (revision 10376) +++ src/sch-rnd/sheet.c (revision 10377) @@ -95,24 +95,28 @@ warn_size(sheet, x2); warn_size(sheet, y2); } -void sch_rnd_sheet_postproc(csch_sheet_t *sheet) +void sch_rnd_sheet_recalc_bbox(csch_sheet_t *sheet) { - sheet->hidlib.grid = rnd_conf.editor.grid; - - if (!sheet->non_graphical) { rnd_coord_t min_x = sheet_attr_crd(sheet, "drawing_min_width", 0); rnd_coord_t min_y = sheet_attr_crd(sheet, "drawing_min_height", 0); - csch_sheet_bbox_update(sheet); + csch_sheet_bbox_update(sheet); - sheet->hidlib.dwg.X1 = C2P(sheet->bbox.x1); - sheet->hidlib.dwg.Y1 = C2P(sheet->bbox.y1); - sheet->hidlib.dwg.X2 = C2P(RND_MAX(min_x, sheet->bbox.x2)); - sheet->hidlib.dwg.Y2 = C2P(RND_MAX(min_y, sheet->bbox.y2)); + sheet->hidlib.dwg.X1 = C2P(sheet->bbox.x1); + sheet->hidlib.dwg.Y1 = C2P(sheet->bbox.y1); + sheet->hidlib.dwg.X2 = C2P(RND_MAX(min_x, sheet->bbox.x2)); + sheet->hidlib.dwg.Y2 = C2P(RND_MAX(min_y, sheet->bbox.y2)); - sch_rnd_sheet_warn_size(sheet, sheet->bbox.x1, sheet->bbox.y1, RND_MAX(min_x, sheet->bbox.x2), RND_MAX(min_y, sheet->bbox.y2)); - } + sch_rnd_sheet_warn_size(sheet, sheet->bbox.x1, sheet->bbox.y1, RND_MAX(min_x, sheet->bbox.x2), RND_MAX(min_y, sheet->bbox.y2)); +} +void sch_rnd_sheet_postproc(csch_sheet_t *sheet) +{ + sheet->hidlib.grid = rnd_conf.editor.grid; + + if (!sheet->non_graphical) + sch_rnd_sheet_recalc_bbox(sheet); + if (sheet->hidlib.fullpath != NULL) { sheet->design_dir = rnd_dirname(sheet->hidlib.fullpath); rnd_conf_force_set_str(conf_core.rc.path.design, sheet->design_dir); Index: src/sch-rnd/sheet.h =================================================================== --- src/sch-rnd/sheet.h (revision 10376) +++ src/sch-rnd/sheet.h (revision 10377) @@ -6,3 +6,6 @@ /* Throw an error when sheet gets too large (only once per sheet) */ void sch_rnd_sheet_warn_size(csch_sheet_t *sheet, csch_coord_t x1, csch_coord_t y1, csch_coord_t x2, csch_coord_t y2); + +/* Recalc from scratch - time consuming but accurate */ +void sch_rnd_sheet_recalc_bbox(csch_sheet_t *sheet);