Commit ec5589c5 authored by Brad Hards's avatar Brad Hards

Implement scale-down for images that would not otherwise fit

on the selected printed page format.

BUG:174447

svn path=/trunk/KDE/kdegraphics/okular/; revision=890775
parent edc7d22c
......@@ -433,7 +433,16 @@ bool TIFFGenerator::print( QPrinter& printer )
if ( i != 0 )
printer.newPage();
p.drawImage( 0, 0, image );
QSize targetSize = printer.pageRect().size();
if ( (image.width() < targetSize.width()) && (image.height() < targetSize.height()) )
{
// draw small images at 100% (don't scale up)
p.drawImage( 0, 0, image );
} else {
// fit to page
p.drawImage( 0, 0, image.scaled( targetSize, Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) );
}
}
return true;
......
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