mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
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:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user