Code

r11516@tres: ted | 2006-04-26 21:30:18 -0700
[inkscape.git] / src / selection-chemistry.cpp
index c87817a40ee8f32d48ae345ab7d7d796a2acd3bb..19f6c4751d569f211766ce1d066934625c8491c2 100644 (file)
@@ -2554,9 +2554,9 @@ void fit_canvas_to_selection(SPDesktop *desktop) {
     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) {
@@ -2566,9 +2566,9 @@ 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) {