diff --git a/src/object/sp-shape.cpp b/src/object/sp-shape.cpp index 68317e1979e3e6824813922be58d9b34e94847c7..1a95e436046449f6a725d1e11b2a6c5f46fc993d 100644 --- a/src/object/sp-shape.cpp +++ b/src/object/sp-shape.cpp @@ -555,25 +555,25 @@ Geom::OptRect SPShape::either_bbox(Geom::Affine const &transform, SPItem::BBoxTy if (!this->_curve || this->_curve->get_pathvector().empty()) { return bbox; } - - bbox = bounds_exact_transformed(this->_curve->get_pathvector(), transform); - - if (!bbox) { - return bbox; - } - if (bboxtype == SPItem::VISUAL_BBOX) { // convert the stroke to a path and calculate that path's geometric bbox - if (!this->style->stroke.isNone() && !this->style->stroke_extensions.hairline) { - Geom::PathVector *pathv = item_to_outline(this, true); // calculate bbox_only - - if (pathv) { - bbox |= bounds_exact_transformed(*pathv, transform); + if (Geom::PathVector *pathv = item_to_outline(this, true)) { // calculate bbox_only + bbox = bounds_exact_transformed(*pathv, transform); delete pathv; } } + } + if (!bbox) { + bbox = bounds_exact_transformed(this->_curve->get_pathvector(), transform); + } + + if (!bbox) { + return bbox; + } + if (bboxtype == SPItem::VISUAL_BBOX) { + // convert the stroke to a path and calculate that path's geometric bbox // Union with bboxes of the markers, if any if ( this->hasMarkers() && !this->_curve->get_pathvector().empty() ) { /** \todo make code prettier! */