summaryrefslogtreecommitdiffstats
path: root/src/graphlayout/graphlayout.cpp
diff options
context:
space:
mode:
authorMenTaLguY <mental@rydia.net>2007-03-10 20:54:38 +0000
committermental <mental@users.sourceforge.net>2007-03-10 20:54:38 +0000
commita99764de718f7331615d3f9449e10a56dee62fb6 (patch)
treed60bc8389777a4384b8c931867a93c6491fffee5 /src/graphlayout/graphlayout.cpp
parentfix setting knot->pos for node handles, but remove coords updating - now done... (diff)
downloadinkscape-a99764de718f7331615d3f9449e10a56dee62fb6.tar.gz
inkscape-a99764de718f7331615d3f9449e10a56dee62fb6.zip
Merge further bbox work
(bzr r2596)
Diffstat (limited to 'src/graphlayout/graphlayout.cpp')
-rw-r--r--src/graphlayout/graphlayout.cpp12
1 files changed, 7 insertions, 5 deletions
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<NR::Rect> 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<NR::Rect> 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));
}