Code

fix 1705412: handle gracefully assigning gradients to no-bbox items
authorbuliabyak <buliabyak@users.sourceforge.net>
Mon, 23 Apr 2007 20:40:50 +0000 (20:40 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Mon, 23 Apr 2007 20:40:50 +0000 (20:40 +0000)
src/gradient-chemistry.cpp

index 7ccc534866576e3ab0a70f51bd070680b9e7e208..fce26435c6b75a6037147b3dda2d888c35e98f8c 100644 (file)
@@ -276,7 +276,9 @@ sp_gradient_reset_to_userspace (SPGradient *gr, SPItem *item)
     sp_document_ensure_up_to_date(SP_OBJECT_DOCUMENT(item));
     NR::Maybe<NR::Rect> bbox = item->getBounds(NR::identity()); // we need "true" bbox without item_i2d_affine
 
-    g_assert( bbox && !bbox->isEmpty() );
+    if ( !bbox || bbox->isEmpty() )
+        return gr;
+
     NR::Coord const width = bbox->dimensions()[NR::X];
     NR::Coord const height = bbox->dimensions()[NR::Y];