Bug 511898: Double-click with two clicks on different areas of the page results in zoom of area of second click [r=combee]

This commit is contained in:
Vivien Nicolas 2009-10-24 01:06:29 -04:00
parent dd01aa90bf
commit 0e7bc42476

View File

@ -1529,8 +1529,12 @@ ContentCustomClicker.prototype = {
},
doubleClick: function doubleClick(cX1, cY1, cX2, cY2) {
if (!Browser.zoomToPoint(cX2, cY2))
Browser.zoomFromPoint(cX2, cY2);
const kDoubleClickRadius = 32;
let maxRadius = kDoubleClickRadius * Browser._browserView.getZoomLevel();
let isClickInRadius = (Math.abs(cX1 - cX2) < maxRadius && Math.abs(cY1 - cY2) < maxRadius);
if (isClickInRadius && !Browser.zoomToPoint(cX1, cY1))
Browser.zoomFromPoint(cX1, cY1);
},
toString: function toString() {