From 2a30d76183149e64f6f668d880552d61d3aa47b1 Mon Sep 17 00:00:00 2001 From: Max Li Date: Sun, 19 Jan 2014 23:22:51 -0800 Subject: [PATCH] Bug 961612 - [AccessFu] Don't scale mouse events specially on Android, r=MarcoZ --- accessible/src/jsat/TouchAdapter.jsm | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/accessible/src/jsat/TouchAdapter.jsm b/accessible/src/jsat/TouchAdapter.jsm index 761314efb39..b0f7b444cf5 100644 --- a/accessible/src/jsat/TouchAdapter.jsm +++ b/accessible/src/jsat/TouchAdapter.jsm @@ -334,8 +334,8 @@ this.TouchAdapter = { * of one single touch. */ function TouchPoint(aTouch, aTime, aDPI) { - this.startX = this.x = aTouch.screenX * this.scaleFactor; - this.startY = this.y = aTouch.screenY * this.scaleFactor; + this.startX = this.x = aTouch.screenX; + this.startY = this.y = aTouch.screenY; this.startTime = aTime; this.distanceTraveled = 0; this.dpi = aDPI; @@ -346,8 +346,8 @@ TouchPoint.prototype = { update: function TouchPoint_update(aTouch, aTime) { let lastX = this.x; let lastY = this.y; - this.x = aTouch.screenX * this.scaleFactor; - this.y = aTouch.screenY * this.scaleFactor; + this.x = aTouch.screenX; + this.y = aTouch.screenY; this.time = aTime; this.distanceTraveled += this.getDistanceToCoord(lastX, lastY); @@ -357,20 +357,6 @@ TouchPoint.prototype = { return Math.sqrt(Math.pow(this.x - aX, 2) + Math.pow(this.y - aY, 2)); }, - get scaleFactor() { - if (!this._scaleFactor) { - // Android events come with the x, y coordinates affected by the widget - // scaling; we restore it to normal here. - if (Utils.MozBuildApp == 'mobile/android') { - this._scaleFactor = Utils.win.devicePixelRatio; - } else { - this._scaleFactor = 1; - } - } - - return this._scaleFactor; - }, - finish: function TouchPoint_finish() { this.done = true; },