Commit d888b204 authored by Albert Astals Cid's avatar Albert Astals Cid

Fix dvi inverse search

distance being in sqr pixels and s_minDistance being a normalized value was not a good idea to compare them ^_^

BUGS: 326605
REVIEW: 120308
parent b958a5e3
......@@ -2350,6 +2350,8 @@ void PageView::mouseReleaseEvent( QMouseEvent * e )
static const double s_minDistance = 0.025; // FIXME?: empirical value?
double distance = 0.0;
rect = pageItem->page()->nearestObjectRect( Okular::ObjectRect::SourceRef, nX, nY, pageItem->uncroppedWidth(), pageItem->uncroppedHeight(), &distance );
// distance is distanceSqr, adapt it to a normalized value
distance = distance / (pow( pageItem->uncroppedWidth(), 2 ) + pow( pageItem->uncroppedHeight(), 2 ));
if ( rect && ( distance > s_minDistance ) )
rect = 0;
}
......
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