summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5d34a7d)
raw | patch | inline | side by side (parent: 5d34a7d)
author | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Tue, 28 Aug 2007 20:19:48 +0000 (20:19 +0000) | ||
committer | dvlierop2 <dvlierop2@users.sourceforge.net> | |
Tue, 28 Aug 2007 20:19:48 +0000 (20:19 +0000) |
src/object-snapper.cpp | patch | blob | history |
diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp
index 57937145a6e75a2b8bee753b474abfde71c16595..785f80960800089d13775404a4a3648ebc6fc4e3 100644 (file)
--- a/src/object-snapper.cpp
+++ b/src/object-snapper.cpp
_findCandidates(c, o, it, p, snap_dim);
} else {
NR::Maybe<NR::Rect> b = sp_item_bbox_desktop(SP_ITEM(o));
- NR::Point b_min = b->min();
- NR::Point b_max = b->max();
- double d = getDistance();
- bool withinX = (p[NR::X] >= b_min[NR::X] - d) && (p[NR::X] <= b_max[NR::X] + d);
- bool withinY = (p[NR::Y] >= b_min[NR::Y] - d) && (p[NR::Y] <= b_max[NR::Y] + d);
- if (snap_dim == SNAP_X && withinX || snap_dim == SNAP_Y && withinY || snap_dim == SNAP_XY && withinX && withinY) {
- c.push_back(SP_ITEM(o));
+ if (b) {
+ NR::Point b_min = b->min();
+ NR::Point b_max = b->max();
+ double d = getDistance();
+ bool withinX = (p[NR::X] >= b_min[NR::X] - d) && (p[NR::X] <= b_max[NR::X] + d);
+ bool withinY = (p[NR::Y] >= b_min[NR::Y] - d) && (p[NR::Y] <= b_max[NR::Y] + d);
+ if (snap_dim == SNAP_X && withinX || snap_dim == SNAP_Y && withinY || snap_dim == SNAP_XY && withinX && withinY) {
+ c.push_back(SP_ITEM(o));
+ }
}
}
- }
-
+ }
}
}
}