Change clippingDisplay() to a property
It fits much better as a property given that it only tells what the current state of things are.
This commit is contained in:
+5
-5
@@ -106,6 +106,11 @@ Display.prototype = {
|
||||
return this._fb_height;
|
||||
},
|
||||
|
||||
get isClipped() {
|
||||
var vp = this._viewportLoc;
|
||||
return this._fb_width > vp.w || this._fb_height > vp.h;
|
||||
},
|
||||
|
||||
logo: null,
|
||||
|
||||
// ===== EVENT HANDLERS =====
|
||||
@@ -512,11 +517,6 @@ Display.prototype = {
|
||||
this._target.style.cursor = "none";
|
||||
},
|
||||
|
||||
clippingDisplay: function () {
|
||||
var vp = this._viewportLoc;
|
||||
return this._fb_width > vp.w || this._fb_height > vp.h;
|
||||
},
|
||||
|
||||
autoscale: function (containerWidth, containerHeight, downscaleOnly) {
|
||||
var vp = this._viewportLoc;
|
||||
var targetAspectRatio = containerWidth / containerHeight;
|
||||
|
||||
+2
-5
@@ -268,6 +268,8 @@ RFB.prototype = {
|
||||
get viewport() { return this._display.viewport; },
|
||||
set viewport(viewport) { this._display.viewport = viewport; },
|
||||
|
||||
get isClipped() { return this._display.isClipped; },
|
||||
|
||||
// ===== EVENT HANDLERS =====
|
||||
|
||||
onupdatestate: function () {}, // onupdatestate(rfb, state, oldstate): connection state change
|
||||
@@ -380,11 +382,6 @@ RFB.prototype = {
|
||||
this._display.viewportChangeSize(width, height);
|
||||
},
|
||||
|
||||
clippingDisplay: function () {
|
||||
if (this._rfb_connection_state !== 'connected') { return false; }
|
||||
return this._display.clippingDisplay();
|
||||
},
|
||||
|
||||
// Requests a change of remote desktop size. This message is an extension
|
||||
// and may only be sent if we have received an ExtendedDesktopSize message
|
||||
requestDesktopSize: function (width, height) {
|
||||
|
||||
Reference in New Issue
Block a user