Changeset 114370 in webkit


Ignore:
Timestamp:
Apr 17, 2012, 6:14:50 AM (13 years ago)
Author:
commit-queue@webkit.org
Message:

[Qt] Zoom out on second double-tap.
https://bugs.webkit.org/show_bug.cgi?id=84145

Patch by Allan Sandfeld Jensen <allan.jensen@nokia.com> on 2012-04-17
Reviewed by Simon Hausmann.

  • UIProcess/qt/QtViewportInteractionEngine.cpp:

(WebKit::QtViewportInteractionEngine::QtViewportInteractionEngine):
(WebKit::QtViewportInteractionEngine::zoomToAreaGestureEnded):
(WebKit::QtViewportInteractionEngine::pinchGestureStarted):

  • UIProcess/qt/QtViewportInteractionEngine.h:

(QtViewportInteractionEngine):

Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r114367 r114370  
     12012-04-17  Allan Sandfeld Jensen  <allan.jensen@nokia.com>
     2
     3        [Qt] Zoom out on second double-tap.
     4        https://bugs.webkit.org/show_bug.cgi?id=84145
     5
     6        Reviewed by Simon Hausmann.
     7
     8        * UIProcess/qt/QtViewportInteractionEngine.cpp:
     9        (WebKit::QtViewportInteractionEngine::QtViewportInteractionEngine):
     10        (WebKit::QtViewportInteractionEngine::zoomToAreaGestureEnded):
     11        (WebKit::QtViewportInteractionEngine::pinchGestureStarted):
     12        * UIProcess/qt/QtViewportInteractionEngine.h:
     13        (QtViewportInteractionEngine):
     14
    1152012-04-17  Mariusz Grzegorczyk  <mariusz.g@samsung.com>
    216
  • trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.cpp

    r114247 r114370  
    126126    , m_hasSuspendedContent(false)
    127127    , m_hadUserInteraction(false)
     128    , m_zoomedToArea(false)
    128129    , m_scaleAnimation(new ScaleAnimation(this))
    129130    , m_pinchStartScale(-1)
     
    364365        return;
    365366
    366     const int margin = 10; // We want at least a little bit or margin.
     367    const int margin = 10; // We want at least a little bit of margin.
    367368    QRectF endArea = itemRectFromCSS(targetArea.adjusted(-margin, -margin, margin, margin));
    368369
     
    371372    qreal targetCSSScale = cssScaleFromItem(viewportRect.size().width() / endArea.size().width());
    372373    qreal endItemScale = itemScaleFromCSS(innerBoundedCSSScale(qMin(targetCSSScale, qreal(2.5))));
     374
     375    // Zoom back out on a second double click, but still center on the new touch point.
     376    if (m_zoomedToArea) {
     377        m_zoomedToArea = false;
     378        endItemScale = 1.0;
     379    } else
     380        m_zoomedToArea = true;
    373381
    374382    // We want to end up with the target area filling the whole width of the viewport (if possible),
     
    526534
    527535    m_hadUserInteraction = true;
     536    m_zoomedToArea = false;
    528537
    529538    m_scaleUpdateDeferrer = adoptPtr(new ViewportUpdateDeferrer(this, ViewportUpdateDeferrer::DeferUpdateAndSuspendContent));
  • trunk/Source/WebKit2/UIProcess/qt/QtViewportInteractionEngine.h

    r114247 r114370  
    146146
    147147    bool m_hadUserInteraction;
     148    bool m_zoomedToArea;
    148149
    149150    class ScaleAnimation : public QVariantAnimation {
Note: See TracChangeset for help on using the changeset viewer.