From 5fedfaeb78cafae515d83dcb5791f542cca6c1a4 Mon Sep 17 00:00:00 2001 From: Changhyup Jwa Date: Sun, 12 May 2013 09:49:19 +0900 Subject: [PATCH] Rescale if scale factor exceeds scalable range by changed contents size [Title] Rescale if scale factor exceeds scalable range by changed contents size [Issue#] N_SE-38068 [Problem] Rotate from landscape to portrait on Google's "Feeling Lucky" page, empty space is displayed on right side. [Cause] Contents size is changed smaller lately after updating scale factor [Solution] If scale factor exceeds scalable range by changed contents size, update scale factor with adjusted value. Change-Id: Ie16865278097878bdd859343bc064ae7ff576c13 --- Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp index 48a978d..06b2457 100755 --- a/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp +++ b/Source/WebKit2/UIProcess/API/efl/PageClientImpl.cpp @@ -663,8 +663,9 @@ void PageClientImpl::didChangeContentsSize(const WebCore::IntSize size) // FIXME: Do we really need to adjust visible content rect at here? // if contents size is changed smaller and visible content rect is outside of content area, // adjust visible content rect - IntRect adjustedVisibleContentRect = adjustVisibleContentRect(m_visibleContentRect, scaleFactor()); - if (adjustedVisibleContentRect != m_visibleContentRect) + bool needScrollAdjustment = (adjustVisibleContentRect(m_visibleContentRect, scaleFactor()) != m_visibleContentRect); + bool needScaleAdjustment = (fabs(adjustScaleWithViewport(scaleFactor()) - scaleFactor()) > numeric_limits::epsilon()); + if (needScrollAdjustment || needScaleAdjustment) setVisibleContentRect(m_visibleContentRect, scaleFactor()); } -- 2.7.4