Fixed fuzzy detection of coord equality in PolyLine engine

(1,0) is not the same as (0,1)
remotes/origin/epub-qtextdoc
Fabio D'Urso 14 years ago
parent ae64a4ba48
commit bc4965f936
  1. 4
      ui/pageviewannotator.cpp

@ -351,10 +351,10 @@ class PolyLineEngine : public AnnotatorEngine
else if ( type == Release ) else if ( type == Release )
{ {
const Okular::NormalizedPoint tmppoint(nX, nY); 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; 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; last = true;
} }

Loading…
Cancel
Save