Bug 830926 - AZPC TrackTouch x/y displacement should not be rounded to int. r=ajones,drs
authorOleg Romashin <romaxa@gmail.com>
Sat, 19 Jan 2013 15:33:09 -0800
changeset 119374 ce70deca6e8e637e4f28f87fa5b7a92951e20a9d
parent 119373 0d4ce26f2c28b1892e25b644bc615702179ff167
child 119375 587ac3f2bd30880393aa13546ae8d6c59ff8200f
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersajones, drs
bugs830926
milestone21.0a1
Bug 830926 - AZPC TrackTouch x/y displacement should not be rounded to int. r=ajones,drs
gfx/layers/ipc/AsyncPanZoomController.cpp
--- a/gfx/layers/ipc/AsyncPanZoomController.cpp
+++ b/gfx/layers/ipc/AsyncPanZoomController.cpp
@@ -751,21 +751,21 @@ void AsyncPanZoomController::TrackTouch(
 
   {
     MonitorAutoLock monitor(mMonitor);
 
     // We want to inversely scale it because when you're zoomed further in, a
     // larger swipe should move you a shorter distance.
     gfxFloat inverseResolution = 1 / CalculateResolution(mFrameMetrics).width;
 
-    int32_t xDisplacement = mX.GetDisplacementForDuration(inverseResolution,
-                                                          timeDelta);
-    int32_t yDisplacement = mY.GetDisplacementForDuration(inverseResolution,
-                                                          timeDelta);
-    if (!xDisplacement && !yDisplacement) {
+    float xDisplacement = mX.GetDisplacementForDuration(inverseResolution,
+                                                        timeDelta);
+    float yDisplacement = mY.GetDisplacementForDuration(inverseResolution,
+                                                        timeDelta);
+    if (fabs(xDisplacement) <= EPSILON && fabs(yDisplacement) <= EPSILON) {
       return;
     }
 
     ScrollBy(gfx::Point(xDisplacement, yDisplacement));
     ScheduleComposite();
 
     TimeDuration timePaintDelta = TimeStamp::Now() - mPreviousPaintStartTime;
     if (timePaintDelta.ToMilliseconds() > gPanRepaintInterval) {