From f58713629a62caff1903cdde0a6a1d8515708d38 Mon Sep 17 00:00:00 2001 From: dvlierop2 Date: Tue, 28 Aug 2007 20:19:48 +0000 Subject: [PATCH] Whoops, put check on empty rect back in! Maybe no one noticed ;-) --- src/object-snapper.cpp | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/object-snapper.cpp b/src/object-snapper.cpp index 57937145a..785f80960 100644 --- a/src/object-snapper.cpp +++ b/src/object-snapper.cpp @@ -62,17 +62,18 @@ void Inkscape::ObjectSnapper::_findCandidates(std::list& c, _findCandidates(c, o, it, p, snap_dim); } else { NR::Maybe 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)); + } } } - } - + } } } } -- 2.30.2