MCPcopy Create free account
hub / github.com/apache/cloudstack / _updateClip

Method _updateClip

systemvm/agent/noVNC/core/rfb.js:901–931  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

899 // Update state of clipping in Display object, and make sure the
900 // configured viewport matches the current screen size
901 _updateClip() {
902 const curClip = this._display.clipViewport;
903 let newClip = this._clipViewport;
904
905 if (this._scaleViewport) {
906 // Disable viewport clipping if we are scaling
907 newClip = false;
908 }
909
910 if (curClip !== newClip) {
911 this._display.clipViewport = newClip;
912 }
913
914 if (newClip) {
915 // When clipping is enabled, the screen is limited to
916 // the size of the container.
917 const size = this._screenSize();
918 this._display.viewportChangeSize(size.w, size.h);
919 this._fixScrollbars();
920 this._setClippingViewport(size.w < this._display.width ||
921 size.h < this._display.height);
922 } else {
923 this._setClippingViewport(false);
924 }
925
926 // When changing clipping we might show or hide scrollbars.
927 // This causes the expected client dimensions to change.
928 if (curClip !== newClip) {
929 this._saveExpectedClientSize();
930 }
931 }
932
933 _updateScale() {
934 if (!this._scaleViewport) {

Callers 4

clipViewportMethod · 0.95
scaleViewportMethod · 0.95
_handleResizeMethod · 0.95
_resizeMethod · 0.95

Calls 5

_screenSizeMethod · 0.95
_fixScrollbarsMethod · 0.95
_setClippingViewportMethod · 0.95
viewportChangeSizeMethod · 0.80

Tested by

no test coverage detected