From: joncruz Date: Mon, 16 Jun 2008 07:40:12 +0000 (+0000) Subject: Fixed NPE X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=897cce8b6607c234ad7d49d994bb477bad321a2f;p=inkscape.git Fixed NPE --- diff --git a/src/display/nr-arena-shape.cpp b/src/display/nr-arena-shape.cpp index 6bcb9e5b8..4b7ceed27 100644 --- a/src/display/nr-arena-shape.cpp +++ b/src/display/nr-arena-shape.cpp @@ -674,14 +674,16 @@ nr_arena_shape_add_bboxes(NRArenaShape* shape, Geom::Rect &bbox) Geom::Interval(shape->stroke_shp->topY, shape->stroke_shp->bottomY) ); bbox.unionWith(stroke_bbox); } + if ( shape->fill_shp ) { shape->fill_shp->CalcBBox(); shape->fill_shp->leftX=floor(shape->fill_shp->leftX); shape->fill_shp->rightX=ceil(shape->fill_shp->rightX); shape->fill_shp->topY=floor(shape->fill_shp->topY); shape->fill_shp->bottomY=ceil(shape->fill_shp->bottomY); - Geom::Rect fill_bbox( Geom::Interval(shape->stroke_shp->leftX, shape->stroke_shp->rightX), - Geom::Interval(shape->stroke_shp->topY, shape->stroke_shp->bottomY) ); + Shape *larger = shape->stroke_shp ? shape->stroke_shp : shape->fill_shp; + Geom::Rect fill_bbox( Geom::Interval(larger->leftX, larger->rightX), + Geom::Interval(larger->topY, larger->bottomY) ); bbox.unionWith(fill_bbox); } }