Bug 533989 - center page when doing incremental zoom [r=mfinkle]

This commit is contained in:
Benjamin Stover 2009-12-10 11:00:46 -08:00
Родитель 6c8df85d18
Коммит 91b30c93d1
1 изменённых файлов: 4 добавлений и 8 удалений

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

@ -1021,14 +1021,10 @@ var Browser = {
},
zoom: function zoom(aDirection) {
Browser._browserView.zoom(aDirection);
//Browser.forceChromeReflow(); // Zoom causes a width/height change to the
// BrowserView's containing element, but
// sometimes doesn't cause the reflow that
// resizes the parent right away, so we
// can preempt it here. Not needed anywhere
// currently but if this becomes API or is
// needed then uncomment this line.
let bv = this._browserView;
let zoomLevel = bv.getZoomLevel() + (aDirection > 0 ? -0.1 : 0.1);
let center = this.getVisibleRect().center().map(bv.viewportToBrowser);
this.setVisibleRect(this._getZoomRectForPoint(center.x, center.y, zoomLevel));
},
/**