#endif // Q_OS_SYMBIAN
+#ifdef Q_OS_SYMBIAN
+
void BookView::adjustPosition()
{
TRACE;
+
+ // QWebView widget doesn't maintain reading positon during orientation
+ // switch. This heuristics tries to work around it.
+
const qreal portraitMagic = 1.66;
const qreal landscapeMagic = 0.655;
if (mBook) {
qreal ratio = (screenWidth<screenHeight)? portraitMagic: landscapeMagic;
QWebFrame *frame = page()->mainFrame();
int current = frame->scrollPosition().y();
- qDebug() << "From" << current << "to" << (int)(current * ratio);
frame->scroll(0, (int)(current * ratio) - current);
}
}
+
+#endif // Q_OS_SYMBIAN