From 5014662ec90a3ec0eb1c5fc261063415eb3f09e0 Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 19 Feb 2012 20:56:03 +0100 Subject: remove superfluous RectHull (bzr r11001) --- src/selection.cpp | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/selection.cpp') diff --git a/src/selection.cpp b/src/selection.cpp index 068c1c00e..d769b402c 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -25,7 +25,7 @@ #include "desktop-handles.h" #include "document.h" #include "selection.h" -#include <2geom/rect-hull.h> +#include <2geom/rect.h> #include "xml/repr.h" #include "preferences.h" @@ -476,18 +476,14 @@ std::vector Selection::getSnapPointsConvexHull(Sna std::vector pHull; if (!p.empty()) { - std::vector::iterator i; - Geom::RectHull cvh((p.front()).getPoint()); - for (i = p.begin(); i != p.end(); ++i) { + Geom::Rect cvh((p.front()).getPoint(), (p.front()).getPoint()); + for (std::vector::iterator i = p.begin(); i != p.end(); ++i) { // these are the points we get back - cvh.add((*i).getPoint()); + cvh.expandTo((*i).getPoint()); } - Geom::OptRect rHull = cvh.bounds(); - if (rHull) { - for ( unsigned i = 0 ; i < 4 ; ++i ) { - pHull.push_back(Inkscape::SnapCandidatePoint(rHull->corner(i), SNAPSOURCE_CONVEX_HULL_CORNER)); - } + for ( unsigned i = 0 ; i < 4 ; ++i ) { + pHull.push_back(Inkscape::SnapCandidatePoint(cvh.corner(i), SNAPSOURCE_CONVEX_HULL_CORNER)); } } -- cgit v1.2.3