Skip to content

Commit fac2bd7

Browse files
committedMar 14, 2013
Prevent overshoots with line offsets
1 parent 8ad1e2a commit fac2bd7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎src/core/symbology-ng/qgssymbollayerv2utils.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -605,8 +605,8 @@ static QPointF offsetPoint( QPointF pt, double angle, double dist )
605605
// calc intersection of two (infinite) lines defined by one point and tangent
606606
static QPointF linesIntersection( QPointF p1, double t1, QPointF p2, double t2 )
607607
{
608-
// parallel lines? (or the difference between angles is less than cca 0.1 degree)
609-
if (( t1 == DBL_MAX && t2 == DBL_MAX ) || qAbs( t1 - t2 ) < 0.001 )
608+
// parallel lines? (or the difference between angles is less than appr. 10 degree)
609+
if (( t1 == DBL_MAX && t2 == DBL_MAX ) || qAbs( atan( t1 ) - atan( t2 ) ) < 0.175 )
610610
return QPointF();
611611

612612
double x, y;

0 commit comments

Comments
 (0)
Please sign in to comment.