189,11 → 189,14 |
{ |
if(!(bike->linePoints[j].x() == bike->linePoints[j+1].x() && linePoints[i].x() == linePoints[i-1].x()) && !(bike->linePoints[j].y() == bike->linePoints[j+1].y() && linePoints[i].y() == linePoints[i-1].y())) |
{ |
|
// If not parallel |
if(bike->linePoints[j].x() == bike->linePoints[j+1].x()) |
{ |
// x equal |
if(linePoints[i-1].x() > bike->linePoints[j].x() && linePoints[i].x() < bike->linePoints[j].x() || linePoints[i-1].x() < bike->linePoints[j].x() && linePoints[i].x() > bike->linePoints[j].x()){ |
|
if(linePoints[i-1].x() > bike->linePoints[j].x() && linePoints[i].x() < bike->linePoints[j].x() || linePoints[i-1].x() < bike->linePoints[j].x() && linePoints[i].x() > bike->linePoints[j].x()) |
{ |
if((sign(linePoints[i-1].y() - bike->linePoints[j].y()) != sign(linePoints[i-1].y() - bike->linePoints[j+1].y()))) |
return true; |
} |
200,6 → 203,7 |
} |
else if(bike->linePoints[j].y() == bike->linePoints[j+1].y()) |
{ |
|
if(linePoints[i-1].y() > bike->linePoints[j].y() && linePoints[i].y() < bike->linePoints[j].y() || linePoints[i-1].y() < bike->linePoints[j].y() && linePoints[i].y() > bike->linePoints[j].y()) |
{ |
if((sign(linePoints[i-1].x() - bike->linePoints[j].x()) != sign(linePoints[i-1].x() - bike->linePoints[j+1].x()))) |