summaryrefslogtreecommitdiffstats
path: root/src/line-snapper.cpp
diff options
context:
space:
mode:
authorPatrick Storz <eduard.braun2@gmx.de>2019-03-03 17:26:09 +0000
committerPatrick Storz <eduard.braun2@gmx.de>2019-03-03 17:26:09 +0000
commited341f5c68174d18efc3d989c7090ba1b579c19b (patch)
treea1a8d0efc0135ab3b61ef61dde8468b14c0664b6 /src/line-snapper.cpp
parentThis patch fixes the behaviour of control-handle locking during (diff)
downloadinkscape-ed341f5c68174d18efc3d989c7090ba1b579c19b.tar.gz
inkscape-ed341f5c68174d18efc3d989c7090ba1b579c19b.zip
Fix CI (clangtidyfull)
Diffstat (limited to 'src/line-snapper.cpp')
-rw-r--r--src/line-snapper.cpp14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/line-snapper.cpp b/src/line-snapper.cpp
index f3be46578..3a065422a 100644
--- a/src/line-snapper.cpp
+++ b/src/line-snapper.cpp
@@ -33,17 +33,16 @@ void Inkscape::LineSnapper::freeSnap(IntermSnapResults &isr,
/* Get the lines that we will try to snap to */
const LineList lines = _getSnapLines(p.getPoint());
- for (LineList::const_iterator i = lines.begin(); i != lines.end(); ++i) {
- Geom::Point const p1 = i->second; // point at guide/grid line
- Geom::Point const p2 = p1 + Geom::rot90(i->first); // 2nd point at guide/grid line
- // std::cout << " line through " << i->second << " with normal " << i->first;
- assert(i->first != Geom::Point(0,0)); // we cannot project on an linesegment of zero length
+ for (const auto & line : lines) {
+ Geom::Point const p1 = line.second; // point at guide/grid line
+ Geom::Point const p2 = p1 + Geom::rot90(line.first); // 2nd point at guide/grid line
+ assert(line.first != Geom::Point(0,0)); // we cannot project on an linesegment of zero length
Geom::Point const p_proj = Geom::projection(p.getPoint(), Geom::Line(p1, p2));
Geom::Coord const dist = Geom::L2(p_proj - p.getPoint());
//Store any line that's within snapping range
if (dist < getSnapperTolerance()) {
- _addSnappedLine(isr, p_proj, dist, p.getSourceType(), p.getSourceNum(), i->first, i->second);
+ _addSnappedLine(isr, p_proj, dist, p.getSourceType(), p.getSourceNum(), line.first, line.second);
// For any line that's within range, we will also look at it's "point on line" p1. For guides
// this point coincides with its origin; for grids this is of no use, but we cannot
// discern between grids and guides here
@@ -79,10 +78,7 @@ void Inkscape::LineSnapper::freeSnap(IntermSnapResults &isr,
}
}
}
-
- // std::cout << " -> distance = " << dist;
}
- // std::cout << std::endl;
}
}