Bug 598368 - "Double tap zoom does not clamp scale until animation finishes" [r=mark.finkle]
authorMatt Brubeck <mbrubeck@mozilla.com>
Tue, 21 Sep 2010 10:21:00 -0400
changeset 66749 3dff38d74bb792965c74ea09a8dae0e52d1879da
parent 66748 45cea9ece01c533bbc2c5abcb47b18bf7b9cfd40
child 66750 a9a908e8484101dbd0da2718cd542fd14489011a
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmark
bugs598368
Bug 598368 - "Double tap zoom does not clamp scale until animation finishes" [r=mark.finkle]
mobile/chrome/content/browser.js
--- a/mobile/chrome/content/browser.js
+++ b/mobile/chrome/content/browser.js
@@ -956,18 +956,20 @@ var Browser = {
     let tab = this.selectedTab;
     if (!tab.allowZoom)
       return null;
 
     let zoomRect = null;
     if (aRect)
       zoomRect = this._getZoomRectForRect(aRect, cY);
 
-    if (!zoomRect && tab.isDefaultZoomLevel())
-      zoomRect = this._getZoomRectForPoint(cX, cY, getBrowser().scale * 2);
+    if (!zoomRect && tab.isDefaultZoomLevel()) {
+      let scale = tab.clampZoomLevel(tab.browser.scale * 2);
+      zoomRect = this._getZoomRectForPoint(cX, cY, scale);
+    }
 
     if (zoomRect)
       this.animatedZoomTo(zoomRect);
 
     return zoomRect;
   },
 
   zoomFromPoint: function zoomFromPoint(cX, cY) {