diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-08-01 20:07:58 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-08-01 20:07:58 +0000 |
| commit | ec3dd49a1ccdf9da38c5605765d5698730e77c8b (patch) | |
| tree | 4ad6969a78832df79b813a2bc36978ada8f51b8a /src/sp-item.cpp | |
| parent | update to latest 2geom (diff) | |
| download | inkscape-ec3dd49a1ccdf9da38c5605765d5698730e77c8b.tar.gz inkscape-ec3dd49a1ccdf9da38c5605765d5698730e77c8b.zip | |
SPItem::getBounds now always returns a Geom::Rect boundingbox.
(bzr r6517)
Diffstat (limited to 'src/sp-item.cpp')
| -rw-r--r-- | src/sp-item.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 691d471ca..5d7177253 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -702,13 +702,20 @@ NR::Maybe<NR::Rect> SPItem::getBounds(NR::Matrix const &transform, return r; } -NR::Maybe<Geom::Rect> +/* + * If the item is empty, or has an empty boundingbox for another reason, this method will + * return an empty rectangle. I.e. "getBounds(...).isEmpty() == true". + */ +Geom::Rect SPItem::getBounds(Geom::Matrix const &transform, SPItem::BBoxType type, unsigned int /*dkey*/) const { NR::Maybe<NR::Rect> r = NR::Nothing(); sp_item_invoke_bbox_full(this, &r, from_2geom(transform), type, TRUE); - return NR::Maybe<Geom::Rect>(to_2geom(*r)); + if (r) + return to_2geom(*r); + else + return Geom::Rect(); // return empty rectangle } void |
