From a99764de718f7331615d3f9449e10a56dee62fb6 Mon Sep 17 00:00:00 2001 From: MenTaLguY Date: Sat, 10 Mar 2007 20:54:38 +0000 Subject: Merge further bbox work (bzr r2596) --- src/graphlayout/graphlayout.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/graphlayout/graphlayout.cpp') diff --git a/src/graphlayout/graphlayout.cpp b/src/graphlayout/graphlayout.cpp index 30085a00f..780532718 100644 --- a/src/graphlayout/graphlayout.cpp +++ b/src/graphlayout/graphlayout.cpp @@ -93,9 +93,10 @@ void graphlayout(GSList const *const items) { ++i) { SPItem *u=*i; - NR::Rect const item_box(sp_item_bbox_desktop(u)); - NR::Point ll(item_box.min()); - NR::Point ur(item_box.max()); + NR::Maybe const item_box(sp_item_bbox_desktop(u)); + g_assert(item_box); + NR::Point ll(item_box->min()); + NR::Point ur(item_box->max()); nodelookup[u->id]=rs.size(); rs.push_back(new Rectangle(ll[0]-spacing,ur[0]+spacing, ll[1]-spacing,ur[1]+spacing)); @@ -188,8 +189,9 @@ void graphlayout(GSList const *const items) { SPItem *u=*it; if(!isConnector(u)) { Rectangle* r=rs[nodelookup[u->id]]; - NR::Rect const item_box(sp_item_bbox_desktop(u)); - NR::Point const curr(item_box.midpoint()); + NR::Maybe item_box(sp_item_bbox_desktop(u)); + g_assert(item_box); + NR::Point const curr(item_box->midpoint()); NR::Point const dest(r->getCentreX(),r->getCentreY()); sp_item_move_rel(u, NR::translate(dest - curr)); } -- cgit v1.2.3