diff --git a/ui/pagepainter.cpp b/ui/pagepainter.cpp index 118ef3568..9f0f923cd 100644 --- a/ui/pagepainter.cpp +++ b/ui/pagepainter.cpp @@ -293,6 +293,7 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula if ( tilesManager ) { backImage = QImage( limits.width(), limits.height(), QImage::Format_ARGB32_Premultiplied ); + backImage.fill( 0xffffffff ); QPainter p( &backImage ); const Okular::NormalizedRect normalizedLimits( limits, scaledWidth, scaledHeight ); QList tiles = tilesManager->tilesAt( normalizedLimits, false ); @@ -433,9 +434,9 @@ void PagePainter::paintCroppedPageOnPainter( QPainter * destPainter, const Okula Q_ASSERT(backImage.format() == QImage::Format_ARGB32_Premultiplied); // precalc constants for normalizing [0,1] page coordinates into normalized [0,1] limit rect coordinates double pageScale = (double)croppedWidth / page->width(); - double xOffset = (double)limits.left() / (double)scaledWidth + crop.left, + double xOffset = (double)limits.left() / (double)scaledWidth, xScale = (double)scaledWidth / (double)limits.width(), - yOffset = (double)limits.top() / (double)scaledHeight + crop.top, + yOffset = (double)limits.top() / (double)scaledHeight, yScale = (double)scaledHeight / (double)limits.height(); // paint all buffered annotations in the page