Bug 1239385 - Use correct coordinate system when computing the amount to scroll during a pinch r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 13 Jan 2016 14:38:51 -0600
changeset 279878 4b06ebb349a986634e9da04f01fee95d06d60566
parent 279877 56c4ea6c45f8824100a8aa8fd47080c4cae5ea34
child 279879 5a980da4afb5db9147b13b717bab3a60ddc67840
push id29893
push usercbook@mozilla.com
push dateThu, 14 Jan 2016 10:50:47 +0000
treeherdermozilla-central@6fa2ab99f52f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1239385
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1239385 - Use correct coordinate system when computing the amount to scroll during a pinch r=botond
gfx/layers/apz/src/AsyncPanZoomController.cpp
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -1450,22 +1450,22 @@ nsEventStatus AsyncPanZoomController::On
 
   {
     ReentrantMonitorAutoEnter lock(mMonitor);
 
     CSSToParentLayerScale userZoom = mFrameMetrics.GetZoom().ToScaleFactor();
     ParentLayerPoint focusPoint = aEvent.mLocalFocusPoint - mFrameMetrics.GetCompositionBounds().TopLeft();
     CSSPoint cssFocusPoint = focusPoint / mFrameMetrics.GetZoom();
 
-    CSSPoint focusChange = (mLastZoomFocus - focusPoint) / userZoom;
+    ParentLayerPoint focusChange = mLastZoomFocus - focusPoint;
     // If displacing by the change in focus point will take us off page bounds,
     // then reduce the displacement such that it doesn't.
     focusChange.x -= mX.DisplacementWillOverscrollAmount(focusChange.x);
     focusChange.y -= mY.DisplacementWillOverscrollAmount(focusChange.y);
-    ScrollBy(focusChange);
+    ScrollBy(focusChange / userZoom);
 
     // When we zoom in with focus, we can zoom too much towards the boundaries
     // that we actually go over them. These are the needed displacements along
     // either axis such that we don't overscroll the boundaries when zooming.
     CSSPoint neededDisplacement;
 
     CSSToParentLayerScale realMinZoom = mZoomConstraints.mMinZoom;
     CSSToParentLayerScale realMaxZoom = mZoomConstraints.mMaxZoom;