Minor Fix: Division by 0 avoided

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2737 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
abhishekm71
2014-01-12 13:22:16 +00:00
parent a7d384ea44
commit ae589a5302

View File

@@ -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());