(width, height)
| 132 | } |
| 133 | |
| 134 | viewportChangeSize(width, height) { |
| 135 | |
| 136 | if (!this._clipViewport || |
| 137 | typeof(width) === "undefined" || |
| 138 | typeof(height) === "undefined") { |
| 139 | |
| 140 | Log.Debug("Setting viewport to full display region"); |
| 141 | width = this._fbWidth; |
| 142 | height = this._fbHeight; |
| 143 | } |
| 144 | |
| 145 | width = Math.floor(width); |
| 146 | height = Math.floor(height); |
| 147 | |
| 148 | if (width > this._fbWidth) { |
| 149 | width = this._fbWidth; |
| 150 | } |
| 151 | if (height > this._fbHeight) { |
| 152 | height = this._fbHeight; |
| 153 | } |
| 154 | |
| 155 | const vp = this._viewportLoc; |
| 156 | if (vp.w !== width || vp.h !== height) { |
| 157 | vp.w = width; |
| 158 | vp.h = height; |
| 159 | |
| 160 | const canvas = this._target; |
| 161 | canvas.width = width; |
| 162 | canvas.height = height; |
| 163 | |
| 164 | // The position might need to be updated if we've grown |
| 165 | this.viewportChangePos(0, 0); |
| 166 | |
| 167 | this._damage(vp.x, vp.y, vp.w, vp.h); |
| 168 | this.flip(); |
| 169 | |
| 170 | // Update the visible size of the target canvas |
| 171 | this._rescale(this._scale); |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | absX(x) { |
| 176 | if (this._scale === 0) { |
no test coverage detected