From 7a41ee5d50a70e77b3d738a277d3fcdb2c3afaf2 Mon Sep 17 00:00:00 2001 From: Mailson Menezes Date: Sat, 22 Jun 2013 11:53:00 +0200 Subject: [PATCH] Fix tiles issue when zooming out a rotated document The issue can be reproduced by zooming a rotated document to 1600% then back to 800% REVIEW: 110905 --- core/tilesmanager.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/tilesmanager.cpp b/core/tilesmanager.cpp index 8a57f6d1f..7600d1a2a 100644 --- a/core/tilesmanager.cpp +++ b/core/tilesmanager.cpp @@ -313,7 +313,8 @@ void TilesManager::Private::setPixmap( const QPixmap *pixmap, const NormalizedRe totalPixels -= tile.pixmap->width()*tile.pixmap->height(); delete tile.pixmap; } - tile.pixmap = new QPixmap( pixmap->copy( tile.rect.geometry( width, height ).translated( -pixmapRect.topLeft() ) ) ); + NormalizedRect rotatedRect = TilesManager::toRotatedRect( tile.rect, rotation ); + tile.pixmap = new QPixmap( pixmap->copy( rotatedRect.geometry( width, height ).translated( -pixmapRect.topLeft() ) ) ); tile.rotation = rotation; totalPixels += tile.pixmap->width()*tile.pixmap->height(); tile.dirty = false;