Title: [93592] trunk/Source/WebKit2
- Revision
- 93592
- Author
- [email protected]
- Date
- 2011-08-23 05:38:23 -0700 (Tue, 23 Aug 2011)
Log Message
[Qt][WK2] ViewportInteractionEngine: the position of the content is not corrected when scaling the page manually
https://bugs.webkit.org/show_bug.cgi?id=66672
Reviewed by Kenneth Rohde Christiansen.
Add the method animateContentIntoBoundariesIfNeeded() to move the content back into both scale and position boundaries.
This method is now used as the entry point for animations in order to avoid bugs regarding scale or position.
The existing animation methods were renamed accordingly for clarity and consistency with the updateContent methods.
* UIProcess/qt/ViewportInteractionEngine.cpp:
(WebKit::ViewportInteractionEngine::panGestureEnded):
(WebKit::ViewportInteractionEngine::pinchGestureEnded):
(WebKit::ViewportInteractionEngine::animateContentIntoBoundariesIfNeeded):
(WebKit::ViewportInteractionEngine::animateContentPositionIntoBoundariesIfNeeded):
(WebKit::ViewportInteractionEngine::animateContentScaleIntoBoundariesIfNeeded):
* UIProcess/qt/ViewportInteractionEngine.h:
Modified Paths
Diff
Modified: trunk/Source/WebKit2/ChangeLog (93591 => 93592)
--- trunk/Source/WebKit2/ChangeLog 2011-08-23 12:21:01 UTC (rev 93591)
+++ trunk/Source/WebKit2/ChangeLog 2011-08-23 12:38:23 UTC (rev 93592)
@@ -1,3 +1,23 @@
+2011-08-23 Benjamin Poulain <[email protected]>
+
+ [Qt][WK2] ViewportInteractionEngine: the position of the content is not corrected when scaling the page manually
+ https://bugs.webkit.org/show_bug.cgi?id=66672
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ Add the method animateContentIntoBoundariesIfNeeded() to move the content back into both scale and position boundaries.
+ This method is now used as the entry point for animations in order to avoid bugs regarding scale or position.
+
+ The existing animation methods were renamed accordingly for clarity and consistency with the updateContent methods.
+
+ * UIProcess/qt/ViewportInteractionEngine.cpp:
+ (WebKit::ViewportInteractionEngine::panGestureEnded):
+ (WebKit::ViewportInteractionEngine::pinchGestureEnded):
+ (WebKit::ViewportInteractionEngine::animateContentIntoBoundariesIfNeeded):
+ (WebKit::ViewportInteractionEngine::animateContentPositionIntoBoundariesIfNeeded):
+ (WebKit::ViewportInteractionEngine::animateContentScaleIntoBoundariesIfNeeded):
+ * UIProcess/qt/ViewportInteractionEngine.h:
+
2011-08-22 Oliver Hunt <[email protected]>
Delay GC triggered NP object destruction to the next runloop cycle
Modified: trunk/Source/WebKit2/UIProcess/qt/ViewportInteractionEngine.cpp (93591 => 93592)
--- trunk/Source/WebKit2/UIProcess/qt/ViewportInteractionEngine.cpp 2011-08-23 12:21:01 UTC (rev 93591)
+++ trunk/Source/WebKit2/UIProcess/qt/ViewportInteractionEngine.cpp 2011-08-23 12:38:23 UTC (rev 93592)
@@ -148,7 +148,7 @@
void ViewportInteractionEngine::panGestureEnded()
{
ViewportUpdateGuard guard(this);
- animateContentPositionToBoundaries();
+ animateContentIntoBoundariesIfNeeded();
}
void ViewportInteractionEngine::pinchGestureStarted()
@@ -185,7 +185,7 @@
{
ViewportUpdateGuard guard(this);
// FIXME: resume the engine after the animation.
- animateContentScaleToBoundaries();
+ animateContentIntoBoundariesIfNeeded();
}
if (m_pinchStartScale != m_content->scale())
emit commitScaleChange();
@@ -248,8 +248,14 @@
// FIXME: if the item cannot be fully in viewport, and is not covering the viewport, push it back in view
}
-void ViewportInteractionEngine::animateContentPositionToBoundaries()
+void ViewportInteractionEngine::animateContentIntoBoundariesIfNeeded()
{
+ animateContentScaleIntoBoundariesIfNeeded();
+ animateContentPositionIntoBoundariesIfNeeded();
+}
+
+void ViewportInteractionEngine::animateContentPositionIntoBoundariesIfNeeded()
+{
const QRectF contentGeometry = m_viewport->mapRectFromItem(m_content, m_content->boundingRect());
QPointF newPos = contentGeometry.topLeft();
@@ -278,7 +284,7 @@
m_content->setPos(newPos);
}
-void ViewportInteractionEngine::animateContentScaleToBoundaries()
+void ViewportInteractionEngine::animateContentScaleIntoBoundariesIfNeeded()
{
const qreal currentScale = m_content->scale();
const qreal boundedScale = qBound(m_constraints.minimumScale, currentScale, m_constraints.maximumScale);
Modified: trunk/Source/WebKit2/UIProcess/qt/ViewportInteractionEngine.h (93591 => 93592)
--- trunk/Source/WebKit2/UIProcess/qt/ViewportInteractionEngine.h 2011-08-23 12:21:01 UTC (rev 93591)
+++ trunk/Source/WebKit2/UIProcess/qt/ViewportInteractionEngine.h 2011-08-23 12:38:23 UTC (rev 93592)
@@ -78,8 +78,9 @@
void updateContentScaleIfNeeded();
void updateContentPositionIfNeeded();
- void animateContentPositionToBoundaries();
- void animateContentScaleToBoundaries();
+ void animateContentIntoBoundariesIfNeeded();
+ void animateContentPositionIntoBoundariesIfNeeded();
+ void animateContentScaleIntoBoundariesIfNeeded();
void scaleContent(const QPointF& centerInContentCoordinate, qreal scale);
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes