From 5f27bf99da7b8add20308ad8747c1acb8ab67190 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Mon, 30 Mar 2009 01:19:11 -0400 Subject: [PATCH] Fix some zi/zo issues. --- common/content/buffer.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/common/content/buffer.js b/common/content/buffer.js index 478d0571..44fe3897 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -74,14 +74,13 @@ function Buffer() //{{{ function bumpZoomLevel(steps, fullZoom) { let values = ZoomManager.zoomValues; - let i = values.indexOf(ZoomManager.snap(ZoomManager.zoom)) + steps; + let cur = values.indexOf(ZoomManager.snap(ZoomManager.zoom)); + let i = cur + steps; + i = Math.max(0, Math.min(values.length - 1, i)); - if (i >= 0 && i < values.length) - setZoom(Math.round(values[i] * 100), fullZoom); - // TODO: I'll leave the behaviour as is for now, but I think this - // should probably just take you to the respective bounds -- djk - else + if (i == cur && fulZoom == ZoomManager.useFullZoom) liberator.beep(); + setZoom(Math.round(values[i] * 100), fullZoom); } function checkScrollYBounds(win, direction)