From: buliabyak Date: Mon, 23 Apr 2007 20:40:50 +0000 (+0000) Subject: fix 1705412: handle gracefully assigning gradients to no-bbox items X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=bf5a354d55754606438002c1294f0177b24d907e;p=inkscape.git fix 1705412: handle gracefully assigning gradients to no-bbox items --- diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp index 7ccc53486..fce26435c 100644 --- a/src/gradient-chemistry.cpp +++ b/src/gradient-chemistry.cpp @@ -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 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];