Bug 450243: properly clamp zoomLevel to avoid zooming bugs, r=mfinkle

This commit is contained in:
Gavin Sharp 2008-08-19 23:32:03 -04:00
parent ff244820e1
commit 5fc144c6d5

View File

@ -512,8 +512,8 @@
// scale to the element's width
var elRect = this._getPagePosition(aElement);
this._zoomLevel = Math.max((this.browser.boxObject.width) / (elRect.width + (2 * margin)),
2);
var zoomLevel = this.browser.boxObject.width / (elRect.width + (2 * margin));
this._zoomLevel = Math.min(zoomLevel, 10);
// pan to the element
this._panTo(Math.max(elRect.x - margin, 0),