Bug 1289531 - Make float to int conversion explicit. r=nical
authorBonstra <b2g.bonstra@bonstra.fr.eu.org>
Wed, 27 Jul 2016 01:02:53 -0700
changeset 348928 a72c26964e282f2e615cbff39c5c39a9c1f5de20
parent 348927 e12eb00eff85fd52e0c27533ec5000ac2ca2d254
child 348929 a4aa4ce0382bbf79b1045cdb6ccc0d66201896e8
push id1230
push userjlund@mozilla.com
push dateMon, 31 Oct 2016 18:13:35 +0000
treeherdermozilla-release@5e06e3766db2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1289531
milestone50.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 1289531 - Make float to int conversion explicit. r=nical
widget/gonk/nsAppShell.cpp
--- a/widget/gonk/nsAppShell.cpp
+++ b/widget/gonk/nsAppShell.cpp
@@ -709,18 +709,18 @@ addMultiTouch(MultiTouchInput& aMultiTou
       radiusX = coords.getAxisValue(AMOTION_EVENT_AXIS_TOUCH_MINOR) / 2;
       radiusY = coords.getAxisValue(AMOTION_EVENT_AXIS_TOUCH_MAJOR) / 2;
       rotationAngle += 90;
     } else {
       radiusX = coords.getAxisValue(AMOTION_EVENT_AXIS_TOUCH_MAJOR) / 2;
       radiusY = coords.getAxisValue(AMOTION_EVENT_AXIS_TOUCH_MINOR) / 2;
     }
 
-    ScreenIntPoint point(floor(coords.getX() + 0.5),
-                         floor(coords.getY() + 0.5));
+    ScreenIntPoint point = ScreenIntPoint::Round(coords.getX(),
+                                                 coords.getY());
 
     SingleTouchData touchData(id, point, ScreenSize(radiusX, radiusY),
                               rotationAngle, force);
 
     aMultiTouch.mTouches.AppendElement(touchData);
 }
 
 void