From 7b719449a3da86fffc1fbd51a32898edeb2b21f8 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Wed, 12 Jan 2011 06:42:02 +1100 Subject: [PATCH] Fix :zoom +{value}. Fixes inverted values of buffer.zoomLevel. --HG-- extra : rebase_source : 6df158ff3ae96b66c085dafe7d5aaa2fcab0ad1d --- common/content/buffer.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/common/content/buffer.js b/common/content/buffer.js index 97017ff0..b8f6af15 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -406,7 +406,7 @@ var Buffer = Module("buffer", { * @property {number} The current browser's zoom level, as a * percentage with 100 as 'normal'. */ - get zoomLevel() config.browser.markupDocumentViewer[this.fullZoom ? "textZoom" : "fullZoom"] * 100, + get zoomLevel() config.browser.markupDocumentViewer[this.fullZoom ? "fullZoom" : "textZoom"] * 100, set zoomLevel(value) { this.setZoom(value, this.fullZoom); }, /** @@ -1079,7 +1079,7 @@ var Buffer = Module("buffer", { ZoomManager.zoom = value / 100; } catch (e if e == Cr.NS_ERROR_ILLEGAL_VALUE) { - return dactyl.echoerr("Illegal value"); + return dactyl.echoerr("Illegal zoom value"); // XXX } if ("FullZoom" in window) @@ -1373,8 +1373,7 @@ var Buffer = Module("buffer", { else if (/^\d+$/.test(arg)) level = parseInt(arg, 10); else if (/^[+-]\d+$/.test(arg)) { - level = buffer.zoomLevel + parseInt(arg, 10); - // relative args shouldn't take us out of range + level = Math.round(buffer.zoomLevel + parseInt(arg, 10)); level = Math.constrain(level, Buffer.ZOOM_MIN, Buffer.ZOOM_MAX); } else