[qet] [2737] Minor Fix: Division by 0 avoided

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 2737
Author:   abhishekm71
Date:     2014-01-12 14:22:16 +0100 (Sun, 12 Jan 2014)
Log Message:
-----------
Minor Fix: Division by 0 avoided

Modified Paths:
--------------
    trunk/sources/qet.cpp

Modified: trunk/sources/qet.cpp
===================================================================
--- trunk/sources/qet.cpp	2014-01-12 00:34:06 UTC (rev 2736)
+++ trunk/sources/qet.cpp	2014-01-12 13:22:16 UTC (rev 2737)
@@ -111,6 +111,7 @@
 	@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());


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/