diff --git a/app/ui.js b/app/ui.js index 37e30413..6d910dd4 100644 --- a/app/ui.js +++ b/app/ui.js @@ -1240,7 +1240,7 @@ var UI = { if (!UI.rfb) return; var resizeMode = UI.getSetting('resize'); - if (resizeMode !== 'scale' && resizeMode !== 'downscale') { + if (resizeMode !== 'scale') { return; } @@ -1250,8 +1250,7 @@ var UI = { return; } - var downscaleOnly = resizeMode === 'downscale'; - UI.rfb.autoscale(screen.w, screen.h, downscaleOnly); + UI.rfb.autoscale(screen.w, screen.h); UI.fixScrollbars(); }, @@ -1294,7 +1293,7 @@ var UI = { var new_clip = UI.getSetting('view_clip'); var resizeSetting = UI.getSetting('resize'); - if (resizeSetting === 'downscale' || resizeSetting === 'scale') { + if (resizeSetting === 'scale') { // Disable viewport clipping if we are scaling new_clip = false; } else if (isTouchDevice) { @@ -1324,7 +1323,7 @@ var UI = { enableDisableViewClip: function() { var resizeSetting = UI.getSetting('resize'); // Disable clipping if we are scaling, connected or on touch - if (resizeSetting === 'downscale' || resizeSetting === 'scale' || + if (resizeSetting === 'scale' || isTouchDevice) { UI.disableSetting('view_clip'); } else { diff --git a/core/display.js b/core/display.js index 87b385ad..e61802a6 100644 --- a/core/display.js +++ b/core/display.js @@ -517,7 +517,7 @@ Display.prototype = { this._target.style.cursor = "none"; }, - autoscale: function (containerWidth, containerHeight, downscaleOnly) { + autoscale: function (containerWidth, containerHeight) { var vp = this._viewportLoc; var targetAspectRatio = containerWidth / containerHeight; var fbAspectRatio = vp.w / vp.h; @@ -529,10 +529,6 @@ Display.prototype = { scaleRatio = containerHeight / vp.h; } - if (scaleRatio > 1.0 && downscaleOnly) { - scaleRatio = 1.0; - } - this._rescale(scaleRatio); }, diff --git a/core/rfb.js b/core/rfb.js index 1f5d964d..882b52b5 100644 --- a/core/rfb.js +++ b/core/rfb.js @@ -351,9 +351,9 @@ RFB.prototype = { RFB.messages.clientCutText(this._sock, text); }, - autoscale: function (width, height, downscaleOnly) { + autoscale: function (width, height) { if (this._rfb_connection_state !== 'connected') { return; } - this._display.autoscale(width, height, downscaleOnly); + this._display.autoscale(width, height); }, viewportChangeSize: function(width, height) { diff --git a/docs/API-internal.md b/docs/API-internal.md index 252b7865..f030dc38 100644 --- a/docs/API-internal.md +++ b/docs/API-internal.md @@ -117,7 +117,7 @@ None | changeCursor | (pixels, mask, hotx, hoty, w, h) | Change cursor appearance | defaultCursor | () | Restore default cursor appearance | disableLocalCursor | () | Disable local (client-side) cursor -| autoscale | (containerWidth, containerHeight, downscaleOnly) | Scale the display +| autoscale | (containerWidth, containerHeight) | Scale the display ### 2.3.3 Callbacks diff --git a/docs/API.md b/docs/API.md index a70f1916..18e96068 100644 --- a/docs/API.md +++ b/docs/API.md @@ -410,7 +410,7 @@ The `RFB.autoscale()` method is used to automatically adjust ##### Syntax - RFB.autoscale( width, height, downscaleOnly ); + RFB.autoscale( width, height ); ###### Parameters @@ -420,9 +420,6 @@ The `RFB.autoscale()` method is used to automatically adjust **`height`** - A `long` specifying the maximum height of the canvas in CSS pixels. -**`downscaleOnly`** - - A `boolean` specifying if the scale must be kept below `1.0`. - #### RFB.requestDesktopSize() The `RFB.requestDesktopSize()` method is used to request a change of diff --git a/tests/test.display.js b/tests/test.display.js index cb2460b9..b8e9b51f 100644 --- a/tests/test.display.js +++ b/tests/test.display.js @@ -272,20 +272,6 @@ describe('Display/Canvas Helper', function () { expect(canvas.width).to.equal(4); expect(canvas.height).to.equal(3); }); - - it('should not upscale when downscaleOnly is true', function () { - display.autoscale(2, 2, true); - expect(display.absX(9)).to.equal(18); - expect(display.absY(18)).to.equal(36); - expect(canvas.clientWidth).to.equal(2); - expect(canvas.clientHeight).to.equal(2); - - display.autoscale(16, 9, true); - expect(display.absX(9)).to.equal(9); - expect(display.absY(18)).to.equal(18); - expect(canvas.clientWidth).to.equal(4); - expect(canvas.clientHeight).to.equal(3); - }); }); describe('drawing', function () { diff --git a/vnc.html b/vnc.html index 76314e58..fba59b1b 100644 --- a/vnc.html +++ b/vnc.html @@ -213,7 +213,6 @@