+2012-04-17 Allan Sandfeld Jensen <allan.jensen@nokia.com>
+
+ [Qt] Zoom out on second double-tap.
+ https://bugs.webkit.org/show_bug.cgi?id=84145
+
+ Reviewed by Simon Hausmann.
+
+ * UIProcess/qt/QtViewportInteractionEngine.cpp:
+ (WebKit::QtViewportInteractionEngine::QtViewportInteractionEngine):
+ (WebKit::QtViewportInteractionEngine::zoomToAreaGestureEnded):
+ (WebKit::QtViewportInteractionEngine::pinchGestureStarted):
+ * UIProcess/qt/QtViewportInteractionEngine.h:
+ (QtViewportInteractionEngine):
+
2012-04-17 Mariusz Grzegorczyk <mariusz.g@samsung.com>
[EFL][WK2] Fix build break when CONTEXT_MENUS is disabled.
, m_suspendCount(0)
, m_hasSuspendedContent(false)
, m_hadUserInteraction(false)
+ , m_zoomedToArea(false)
, m_scaleAnimation(new ScaleAnimation(this))
, m_pinchStartScale(-1)
{
if (scrollAnimationActive() || scaleAnimationActive())
return;
- const int margin = 10; // We want at least a little bit or margin.
+ const int margin = 10; // We want at least a little bit of margin.
QRectF endArea = itemRectFromCSS(targetArea.adjusted(-margin, -margin, margin, margin));
const QRectF viewportRect = m_viewport->boundingRect();
qreal targetCSSScale = cssScaleFromItem(viewportRect.size().width() / endArea.size().width());
qreal endItemScale = itemScaleFromCSS(innerBoundedCSSScale(qMin(targetCSSScale, qreal(2.5))));
+ // Zoom back out on a second double click, but still center on the new touch point.
+ if (m_zoomedToArea) {
+ m_zoomedToArea = false;
+ endItemScale = 1.0;
+ } else
+ m_zoomedToArea = true;
+
// We want to end up with the target area filling the whole width of the viewport (if possible),
// and centralized vertically where the user requested zoom. Thus our hotspot is the center of
// the targetArea x-wise and the requested zoom position, y-wise.
return;
m_hadUserInteraction = true;
+ m_zoomedToArea = false;
m_scaleUpdateDeferrer = adoptPtr(new ViewportUpdateDeferrer(this, ViewportUpdateDeferrer::DeferUpdateAndSuspendContent));