mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-27 04:05:32 +00:00
Bug 450243: properly clamp zoomLevel to avoid zooming bugs, r=mfinkle
This commit is contained in:
parent
ff244820e1
commit
5fc144c6d5
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user