Commit bc4965f9 authored by Fabio D'Urso's avatar Fabio D'Urso

Fixed fuzzy detection of coord equality in PolyLine engine

(1,0) is not the same as (0,1)
parent ae64a4ba
......@@ -351,10 +351,10 @@ class PolyLineEngine : public AnnotatorEngine
else if ( type == Release )
{
const Okular::NormalizedPoint tmppoint(nX, nY);
if ( fabs( tmppoint.x - newPoint.x + tmppoint.y - newPoint.y ) > 1e-2 )
if ( fabs( tmppoint.x - newPoint.x ) + fabs( tmppoint.y - newPoint.y ) > 1e-2 )
return rect;
if ( numofpoints == -1 && points.count() > 1 && ( fabs( points[0].x - newPoint.x + points[0].y - newPoint.y ) < 1e-2 ) )
if ( numofpoints == -1 && points.count() > 1 && ( fabs( points[0].x - newPoint.x ) + fabs( points[0].y - newPoint.y ) < 1e-2 ) )
{
last = true;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment