From ef2e57886d26946690d4f98db587fc6cd3ec615a Mon Sep 17 00:00:00 2001 From: Diederik van Lierop Date: Thu, 27 Dec 2007 19:45:52 +0000 Subject: Snapping a guide to nodes (while dragging it across the canvas) now also works for angled guides (bzr r4321) --- src/libnr/nr-point-fns.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/libnr') diff --git a/src/libnr/nr-point-fns.cpp b/src/libnr/nr-point-fns.cpp index 4428ed9b3..a7b128bdb 100644 --- a/src/libnr/nr-point-fns.cpp +++ b/src/libnr/nr-point-fns.cpp @@ -111,6 +111,8 @@ project_on_linesegment(NR::Point const p, NR::Point const p1, NR::Point const p2 // calculate u according to "Minimum Distance between a Point and a Line" // see http://local.wasp.uwa.edu.au/~pbourke/geometry/pointline/ + // Warning: projected points will not necessarily be in between the endpoints of the linesegments! + if (p1 == p2) { // to avoid div. by zero below return p; } -- cgit v1.2.3