index c87817a40ee8f32d48ae345ab7d7d796a2acd3bb..19f6c4751d569f211766ce1d066934625c8491c2 100644 (file)
NRRect bbox = {0,0,0,0};
desktop->selection->bounds(&bbox);
- g_return_if_fail(!empty(bbox));
-
- doc->fitToRect(bbox);
+ if (!empty(bbox)) {
+ doc->fitToRect(bbox);
+ }
};
void fit_canvas_to_drawing(SPDocument *doc) {
sp_document_ensure_up_to_date (doc);
sp_item_invoke_bbox(SP_ITEM(doc->root), &bbox, sp_item_i2r_affine(SP_ITEM(doc->root)), TRUE);
- g_return_if_fail(!empty(bbox));
-
- doc->fitToRect(bbox);
+ if (!empty(bbox)) {
+ doc->fitToRect(bbox);
+ }
};
void fit_canvas_to_selection_or_drawing(SPDesktop *desktop) {