Fixed repaining after orientation change

This commit is contained in:
Slava Monich 2015-07-03 17:24:20 +03:00
parent 220f4feaa3
commit 752c8b1dd7
2 changed files with 4 additions and 11 deletions

View file

@ -165,7 +165,6 @@ BooksPageWidget::BooksPageWidget(QQuickItem* aParent) :
iSettings(NULL),
iResetTask(NULL),
iRenderTask(NULL),
iPaintRequest(false),
iEmpty(false),
iPage(-1)
{
@ -349,8 +348,7 @@ void BooksPageWidget::paint(QPainter* aPainter)
aPainter->drawImage(0, 0, *iImage);
iEmpty = false;
} else if (iPage >= 0 && iPageMark.valid()) {
if (!iPaintRequest) {
iPaintRequest = true;
if (!iRenderTask) {
HDEBUG("page" << iPage << "(scheduled)");
scheduleRepaint();
} else {
@ -420,11 +418,7 @@ void BooksPageWidget::onResetTaskDone()
iResetTask->iData = NULL;
iResetTask->release(this);
iResetTask = NULL;
if (iPaintRequest) {
scheduleRepaint();
} else {
update();
}
}
void BooksPageWidget::onRenderTaskDone()
@ -434,13 +428,13 @@ void BooksPageWidget::onRenderTaskDone()
iImage = iRenderTask->iImage;
iRenderTask->release(this);
iRenderTask = NULL;
iPaintRequest = false;
update();
}
void BooksPageWidget::updateSize()
{
HDEBUG(QSize(width(), height()));
HDEBUG("page" << iPage << QSize(width(), height()));
iImage.reset();
resetView();
}

View file

@ -134,7 +134,6 @@ private:
shared_ptr<QImage> iImage;
ResetTask* iResetTask;
RenderTask* iRenderTask;
bool iPaintRequest;
bool iEmpty;
int iPage;
};