void PageClientImpl::didChangeViewportProperties(const WebCore::ViewportAttributes& attributes)
{
+ double scaleRatioBeforeRotation = m_scaleFactor / m_viewportConstraints.minimumScale;
m_viewportConstraints = computeViewportConstraints(attributes);
// if content is reloaded, contents size will not be changed
return;
float newScale = scaleFactor();
+ IntPoint newScrollPosition = m_visibleContentRect.location();
Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_object_evas_get(m_viewImpl->view()));
int angle = ecore_evas_rotation_get(ee);
bool isRotated = (angle != m_viewportAngle);
// if it's rotated, we need to fit content to viewport by minimize the scale
if (isRotated) {
m_viewportAngle = angle;
- if (m_viewportFitsToContent)
- newScale = m_viewportConstraints.minimumScale;
+ newScale = m_viewportConstraints.minimumScale * scaleRatioBeforeRotation;
+ newScrollPosition.scale(newScale / m_scaleFactor, newScale / m_scaleFactor);
}
#if ENABLE(TIZEN_PRERENDERING_FOR_ROTATION)
#endif
#if ENABLE(TIZEN_WEBKIT2_TILED_BACKING_STORE)
- setVisibleContentRect(m_visibleContentRect, newScale);
+ setVisibleContentRect(IntRect(newScrollPosition, m_visibleContentRect.size()), newScale);
#else
- m_viewImpl->page()->scalePage(newScale, m_visibleContentRect.location());
+ m_viewImpl->page()->scalePage(newScale, newScrollPosition);
#endif
#if ENABLE(TIZEN_WEBKIT2_FORM_DATABASE)