diff options
| author | MenTaLguY <mental@rydia.net> | 2007-03-05 05:50:20 +0000 |
|---|---|---|
| committer | mental <mental@users.sourceforge.net> | 2007-03-05 05:50:20 +0000 |
| commit | d4867888572ff1cf3d5bbeaed8c68431f6834941 (patch) | |
| tree | 95fbc8812495b00ce09c6f7dc46610eeba9fc9ca /src/sp-item.cpp | |
| parent | clean up operators/constructors, and give reference-maybes a more compact (diff) | |
| download | inkscape-d4867888572ff1cf3d5bbeaed8c68431f6834941.tar.gz inkscape-d4867888572ff1cf3d5bbeaed8c68431f6834941.zip | |
Separate NRRect and NR::Rect a bit further; the goal is to get to the point where there is no way to create an empty NR::Rect
(bzr r2551)
Diffstat (limited to 'src/sp-item.cpp')
| -rw-r--r-- | src/sp-item.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/sp-item.cpp b/src/sp-item.cpp index 521d2d1cc..22114cd5b 100644 --- a/src/sp-item.cpp +++ b/src/sp-item.cpp @@ -714,11 +714,7 @@ NR::Maybe<NR::Rect> SPItem::getBounds(NR::Matrix const &transform, { NRRect r; sp_item_invoke_bbox_full(this, &r, transform, type, TRUE); - if (nr_rect_d_test_empty(&r)) { - return NR::Nothing(); - } else { - return NR::Rect(r); - } + return r; } void @@ -804,7 +800,13 @@ NR::Rect sp_item_bbox_desktop(SPItem *item) { NRRect ret; sp_item_invoke_bbox(item, &ret, sp_item_i2d_affine(item), TRUE); - return NR::Rect(ret); + NR::Maybe<NR::Rect> result = ret.upgrade(); + if (result) { + return *result; + } else { + // FIXME + return NR::Rect(NR::Point(0, 0), NR::Point(0, 0)); + } } static void sp_item_private_snappoints(SPItem const *item, SnapPointsIter p) |
