()
| 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) { |
no test coverage detected