summaryrefslogtreecommitdiffstats
path: root/src/sp-item.cpp
diff options
context:
space:
mode:
authorMenTaLguY <mental@rydia.net>2007-03-05 05:50:20 +0000
committermental <mental@users.sourceforge.net>2007-03-05 05:50:20 +0000
commitd4867888572ff1cf3d5bbeaed8c68431f6834941 (patch)
tree95fbc8812495b00ce09c6f7dc46610eeba9fc9ca /src/sp-item.cpp
parentclean up operators/constructors, and give reference-maybes a more compact (diff)
downloadinkscape-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.cpp14
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)