From ae589a530254b763cf40b2567c983c3f2cf513fa Mon Sep 17 00:00:00 2001 From: abhishekm71 Date: Sun, 12 Jan 2014 13:22:16 +0000 Subject: [PATCH] Minor Fix: Division by 0 avoided git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2737 bfdf4180-ca20-0410-9c96-a3a8aa849046 --- sources/qet.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/sources/qet.cpp b/sources/qet.cpp index d5cf35231..290201b4f 100644 --- a/sources/qet.cpp +++ b/sources/qet.cpp @@ -111,6 +111,7 @@ QET::Orientation QET::previousOrientation(QET::Orientation o) { @return true si le point appartient au segment de droite, false sinon */ bool QET::lineContainsPoint(const QLineF &line, const QPointF &point) { + if (point == line.p1()) return(true); QLineF point_line(line.p1(), point); if (point_line.unitVector() != line.unitVector()) return(false); return(point_line.length() <= line.length());