From bc4965f936c18cc6e3f4e4065f8048e2e384860b Mon Sep 17 00:00:00 2001 From: Fabio D'Urso Date: Sat, 28 Jul 2012 17:19:16 +0200 Subject: [PATCH] Fixed fuzzy detection of coord equality in PolyLine engine (1,0) is not the same as (0,1) --- ui/pageviewannotator.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/pageviewannotator.cpp b/ui/pageviewannotator.cpp index 237368b61..d1d259e0a 100644 --- a/ui/pageviewannotator.cpp +++ b/ui/pageviewannotator.cpp @@ -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; }