@galacean/engine-rhi-webgl 0.9.3 → 0.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -1793,23 +1793,23 @@ exports.WebGLMode = void 0;
1793
1793
  };
1794
1794
  _proto.activeRenderTarget = function activeRenderTarget(renderTarget, viewport, mipLevel) {
1795
1795
  var gl = this._gl;
1796
+ var bufferWidth, bufferHeight;
1796
1797
  if (renderTarget) {
1797
1798
  var /** @ts-ignore */ _renderTarget__platformRenderTarget;
1798
1799
  (_renderTarget__platformRenderTarget = renderTarget._platformRenderTarget) == null ? void 0 : _renderTarget__platformRenderTarget._activeRenderTarget();
1799
- var width = renderTarget.width >> mipLevel;
1800
- var height = renderTarget.height >> mipLevel;
1801
- this.viewport(0, 0, width, height);
1802
- this.scissor(0, 0, width, height);
1800
+ bufferWidth = renderTarget.width >> mipLevel;
1801
+ bufferHeight = renderTarget.height >> mipLevel;
1803
1802
  } else {
1804
1803
  gl.bindFramebuffer(gl.FRAMEBUFFER, null);
1805
- var drawingBufferWidth = gl.drawingBufferWidth, drawingBufferHeight = gl.drawingBufferHeight;
1806
- var width1 = drawingBufferWidth * viewport.z;
1807
- var height1 = drawingBufferHeight * viewport.w;
1808
- var x = viewport.x * drawingBufferWidth;
1809
- var y = drawingBufferHeight - viewport.y * drawingBufferHeight - height1;
1810
- this.viewport(x, y, width1, height1);
1811
- this.scissor(x, y, width1, height1);
1812
- }
1804
+ bufferWidth = gl.drawingBufferWidth;
1805
+ bufferHeight = gl.drawingBufferHeight;
1806
+ }
1807
+ var width = bufferWidth * viewport.z;
1808
+ var height = bufferHeight * viewport.w;
1809
+ var x = viewport.x * bufferWidth;
1810
+ var y = bufferHeight - viewport.y * bufferHeight - height;
1811
+ this.viewport(x, y, width, height);
1812
+ this.scissor(x, y, width, height);
1813
1813
  };
1814
1814
  _proto.activeTexture = function activeTexture(textureID) {
1815
1815
  if (this._activeTextureID !== textureID) {