mirror of
https://invent.kde.org/graphics/okular
synced 2024-11-05 18:34:53 +00:00
delete the old rotation code and make this generator working again
svn path=/trunk/playground/graphics/okular/; revision=599791
This commit is contained in:
parent
90ee1a0547
commit
9b5a184aa3
1 changed files with 6 additions and 9 deletions
|
@ -8,9 +8,7 @@
|
|||
***************************************************************************/
|
||||
|
||||
#include <qpainter.h>
|
||||
#include <qpixmap.h>
|
||||
#include <qimage.h>
|
||||
#include <kimageeffect.h>
|
||||
#include <kprinter.h>
|
||||
|
||||
#include "core/page.h"
|
||||
|
@ -54,13 +52,12 @@ bool KIMGIOGenerator::canGeneratePixmap( bool /* async */ ) const
|
|||
void KIMGIOGenerator::generatePixmap( Okular::PixmapRequest * request )
|
||||
{
|
||||
// perform a smooth scaled generation
|
||||
QImage smoothImage = m_pix->toImage().scaled( request->width(), request->height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation );
|
||||
// rotate, if necessary
|
||||
int rotation = request->page()->rotation();
|
||||
QImage finalImage = rotation > 0
|
||||
? KImageEffect::rotate( smoothImage, (KImageEffect::RotateDirection)( rotation - 1 ) )
|
||||
: smoothImage;
|
||||
request->page()->setImage(request->id(), finalImage);
|
||||
int width = request->width();
|
||||
int height = request->height();
|
||||
if ( request->page()->rotation() % 2 == 1 )
|
||||
qSwap( width, height );
|
||||
QImage image = m_pix->toImage().scaled( width, height, Qt::IgnoreAspectRatio, Qt::SmoothTransformation );
|
||||
request->page()->setImage( request->id(), image );
|
||||
|
||||
// signal that the request has been accomplished
|
||||
signalRequestDone(request);
|
||||
|
|
Loading…
Reference in a new issue