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

View file

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