mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 06:07:59 +01:00
Fix :zoom +{value}.
Fixes inverted values of buffer.zoomLevel. --HG-- extra : rebase_source : 6df158ff3ae96b66c085dafe7d5aaa2fcab0ad1d
This commit is contained in:
@@ -406,7 +406,7 @@ var Buffer = Module("buffer", {
|
|||||||
* @property {number} The current browser's zoom level, as a
|
* @property {number} The current browser's zoom level, as a
|
||||||
* percentage with 100 as 'normal'.
|
* 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); },
|
set zoomLevel(value) { this.setZoom(value, this.fullZoom); },
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1079,7 +1079,7 @@ var Buffer = Module("buffer", {
|
|||||||
ZoomManager.zoom = value / 100;
|
ZoomManager.zoom = value / 100;
|
||||||
}
|
}
|
||||||
catch (e if e == Cr.NS_ERROR_ILLEGAL_VALUE) {
|
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)
|
if ("FullZoom" in window)
|
||||||
@@ -1373,8 +1373,7 @@ var Buffer = Module("buffer", {
|
|||||||
else if (/^\d+$/.test(arg))
|
else if (/^\d+$/.test(arg))
|
||||||
level = parseInt(arg, 10);
|
level = parseInt(arg, 10);
|
||||||
else if (/^[+-]\d+$/.test(arg)) {
|
else if (/^[+-]\d+$/.test(arg)) {
|
||||||
level = buffer.zoomLevel + parseInt(arg, 10);
|
level = Math.round(buffer.zoomLevel + parseInt(arg, 10));
|
||||||
// relative args shouldn't take us out of range
|
|
||||||
level = Math.constrain(level, Buffer.ZOOM_MIN, Buffer.ZOOM_MAX);
|
level = Math.constrain(level, Buffer.ZOOM_MIN, Buffer.ZOOM_MAX);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user