Fix highlight/annotation clipping with Qt scaling

Summary:
pixelValue/pixelValue will give us a normalised value.

Normalised values shouldn't be modified by a device pixel ratio.
We want scaledRect not dScaledRect.

BUG: 386110

Test Plan:
Searched for text. Zoomed in, panned about
Created annotations, they still seemed to work

Subscribers: #okular

Tags: #okular

Differential Revision: https://phabricator.kde.org/D8832
remotes/origin/Applications/18.04
David Edmundson 8 years ago
parent 3e2e5d2b36
commit 1a3dc7d8e0
  1. 8
      ui/pagepainter.cpp

@ -153,10 +153,10 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula
if ( canDrawHighlights || canDrawTextSelection || canDrawAnnotations )
{
// precalc normalized 'limits rect' for intersection
double nXMin = ( (double)limits.left() / dScaledWidth ) + crop.left,
nXMax = ( (double)limits.right() / dScaledWidth ) + crop.left,
nYMin = ( (double)limits.top() / dScaledHeight ) + crop.top,
nYMax = ( (double)limits.bottom() / dScaledHeight ) + crop.top;
double nXMin = ( (double)limits.left() / scaledWidth ) + crop.left,
nXMax = ( (double)limits.right() / scaledWidth ) + crop.left,
nYMin = ( (double)limits.top() / scaledHeight ) + crop.top,
nYMax = ( (double)limits.bottom() / scaledHeight ) + crop.top;
// append all highlights inside limits to their list
if ( canDrawHighlights )
{

Loading…
Cancel
Save