Bug 593499 - Increase the double-tap thresholds [r=mfinkle]

This commit is contained in:
Matt Brubeck 2010-09-05 07:23:01 -07:00
Родитель aa47aa497d
Коммит 0111025cd1
3 изменённых файлов: 8 добавлений и 6 удалений

Просмотреть файл

@ -46,7 +46,7 @@
const kDoubleClickInterval = 400;
// threshold in ms to detect if the click is possibly a dblClick
const kDoubleClickThreshold = 200;
const kDoubleClickThreshold = 300;
// threshold in pixels for sensing a tap as opposed to a pan
const kTapRadius = 25;

Просмотреть файл

@ -1632,11 +1632,13 @@ ContentCustomClicker.prototype = {
this._dispatchMouseEvent("Browser:MouseCancel");
const kDoubleClickRadius = 32;
const kDoubleClickRadius = 100;
let maxRadius = kDoubleClickRadius * Browser._browserView.getZoomLevel();
let isClickInRadius = (Math.abs(aX1 - aX2) < maxRadius && Math.abs(aY1 - aY2) < maxRadius);
if (isClickInRadius)
let dx = aX2 - aX1;
let dy = aY1 - aY2;
if (dx*dx + dy*dy < maxRadius*maxRadius)
this._dispatchMouseEvent("Browser:ZoomToPoint", aX1, aY1);
},

Просмотреть файл

@ -2,7 +2,7 @@
dump("###################################### content loaded\n");
// how many milliseconds before the mousedown and the overlay of an element
const kTapOverlayTimeout = 200;
const kTapOverlayTimeout = 300;
let Cc = Components.classes;
let Ci = Components.interfaces;
@ -501,7 +501,7 @@ Content.prototype = {
// We add a few milliseconds because of how the InputHandler wait before
// dispatching a single click (default: 500)
this._contextTimeout.once(500 + 200, function() {
this._contextTimeout.once(500 + kTapOverlayTimeout, function() {
let event = content.document.createEvent("PopupEvents");
event.initEvent("contextmenu", true, true);
element.dispatchEvent(event);