From 75e884d8b3871ce2f7b7fab2b79847a192b29f08 Mon Sep 17 00:00:00 2001 From: dvlierop2 Date: Fri, 13 Apr 2007 21:02:29 +0000 Subject: [PATCH] Some cleaning and reordering --- src/seltrans.cpp | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/src/seltrans.cpp b/src/seltrans.cpp index 228b4fec0..3de87ae28 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -261,7 +261,12 @@ void Inkscape::SelTrans::grab(NR::Point const &p, gdouble x, gdouble y, bool sho // The selector tool should snap the bbox and the special snappoints, but not path nodes // (The special points are the handles, center, rotation axis, font baseline, ends of spiral, etc.) - // First, get all special points for snapping + // First, determine the bounding box for snapping ... + _bbox = selection->bounds(_snap_bbox_type); + _approximate_bbox = selection->bounds(SPItem::APPROXIMATE_BBOX); // Used for correctly scaling the strokewidth + + + // Next, get all special points for snapping _snap_points = selection->getSnapPoints(); // Excludes path nodes std::vector snap_points_hull = selection->getSnapPointsConvexHull(); // Includes path nodes if (_snap_points.size() > 100) { @@ -286,11 +291,6 @@ void Inkscape::SelTrans::grab(NR::Point const &p, gdouble x, gdouble y, bool sho } } - // Next, determine the bounding box for snapping ... - _bbox = selection->bounds(_snap_bbox_type); - - _approximate_bbox = selection->bounds(SPItem::APPROXIMATE_BBOX); // Used for correctly scaling the strokewidth - _bbox_points.clear(); if (_bbox) { // ... and add the bbox corners to _bbox_points @@ -594,23 +594,7 @@ void Inkscape::SelTrans::_updateVolatileState() return; } - // First, get all special points for snapping - std::vector snap_points_hull = selection->getSnapPointsConvexHull(); // Includes path nodes - // Find bbox hulling all special points, which excludes stroke width. Here we need to include the - // path nodes, for example because a rectangle which has been converted to a path doesn't have - // any other special points - NR::Rect snap_points_bbox; - if ( snap_points_hull.empty() == false ) { - std::vector::iterator i = snap_points_hull.begin(); - snap_points_bbox = NR::Rect(*i, *i); - i++; - while (i != snap_points_hull.end()) { - snap_points_bbox.expandTo(*i); - i++; - } - } - - // Next, determine the bounding box for snapping ... + //Update the bboxes _bbox = selection->bounds(_snap_bbox_type); _approximate_bbox = selection->bounds(SPItem::APPROXIMATE_BBOX); -- 2.30.2