diff options
| author | MenTaLguY <mental@rydia.net> | 2007-03-10 20:54:38 +0000 |
|---|---|---|
| committer | mental <mental@users.sourceforge.net> | 2007-03-10 20:54:38 +0000 |
| commit | a99764de718f7331615d3f9449e10a56dee62fb6 (patch) | |
| tree | d60bc8389777a4384b8c931867a93c6491fffee5 /src/desktop.cpp | |
| parent | fix setting knot->pos for node handles, but remove coords updating - now done... (diff) | |
| download | inkscape-a99764de718f7331615d3f9449e10a56dee62fb6.tar.gz inkscape-a99764de718f7331615d3f9449e10a56dee62fb6.zip | |
Merge further bbox work
(bzr r2596)
Diffstat (limited to 'src/desktop.cpp')
| -rw-r--r-- | src/desktop.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/desktop.cpp b/src/desktop.cpp index e1cc23083..471ac2a19 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -430,8 +430,12 @@ bool SPDesktop::isLayer(SPObject *object) const { bool SPDesktop::isWithinViewport (SPItem *item) const { NR::Rect const viewport = get_display_area(); - NR::Rect const bbox = sp_item_bbox_desktop(item); - return viewport.contains(bbox); + NR::Maybe<NR::Rect> const bbox = sp_item_bbox_desktop(item); + if (bbox) { + return viewport.contains(*bbox); + } else { + return true; + } } /// @@ -881,16 +885,16 @@ SPDesktop::zoom_drawing() SPItem *docitem = SP_ITEM (sp_document_root (doc())); g_return_if_fail (docitem != NULL); - NR::Rect d = sp_item_bbox_desktop(docitem); + NR::Maybe<NR::Rect> d = sp_item_bbox_desktop(docitem); /* Note that the second condition here indicates that ** there are no items in the drawing. */ - if ( d.dimensions()[NR::X] < 1.0 || d.dimensions()[NR::Y] < 1.0 ) { + if ( !d || d->dimensions()[NR::X] < 1.0 || d->dimensions()[NR::Y] < 1.0 ) { return; } - set_display_area(d, 10); + set_display_area(*d, 10); } /** |
