From 72cc39b9f0b340548f395c7f61ca9662b34aea09 Mon Sep 17 00:00:00 2001 From: Krzysztof Kosi??ski Date: Sat, 27 Aug 2011 11:04:37 +0200 Subject: Refactor SPItem bounding box methods: remove NRRect usage and make code using them more obvious. Fix filter region computation. (bzr r10582.1.1) --- src/desktop.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/desktop.cpp') diff --git a/src/desktop.cpp b/src/desktop.cpp index ca5fdc63b..b622d1080 100644 --- a/src/desktop.cpp +++ b/src/desktop.cpp @@ -577,16 +577,16 @@ bool SPDesktop::isLayer(SPObject *object) const { } /** - * True if desktop viewport fully contains \a item's bbox. + * True if desktop viewport intersects \a item's bbox. */ bool SPDesktop::isWithinViewport (SPItem *item) const { Geom::Rect const viewport = get_display_area(); - Geom::OptRect const bbox = item->getBboxDesktop(); + Geom::OptRect const bbox = item->desktopVisualBounds(); if (bbox) { - return viewport.contains(*bbox); + return viewport.intersects(*bbox); } else { - return true; + return false; } } @@ -957,7 +957,7 @@ SPDesktop::zoom_quick (bool enable) } if (!zoomed) { - Geom::OptRect const d = selection->bounds(); + Geom::OptRect const d = selection->visualBounds(); if (d && d->area() * 2.0 < _quick_zoom_stored_area.area()) { set_display_area(*d, true); zoomed = true; @@ -1109,7 +1109,7 @@ SPDesktop::zoom_page_width() void SPDesktop::zoom_selection() { - Geom::OptRect const d = selection->bounds(); + Geom::OptRect const d = selection->visualBounds(); if ( !d || d->minExtent() < 0.1 ) { return; @@ -1137,7 +1137,7 @@ SPDesktop::zoom_drawing() SPItem *docitem = doc()->getRoot(); g_return_if_fail (docitem != NULL); - Geom::OptRect d = docitem->getBboxDesktop(); + Geom::OptRect d = docitem->desktopVisualBounds(); /* Note that the second condition here indicates that ** there are no items in the drawing. -- cgit v1.2.3