@galacean/engine-rhi-webgl 1.0.0-beta.3 → 1.0.0-beta.4

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
@@ -207,6 +207,7 @@ function _inherits(subClass, superClass) {
207
207
  var webCanvas = new WebCanvas(typeof canvas === "string" ? document.getElementById(canvas) : canvas);
208
208
  var webGLGraphicDevice = new WebGLGraphicDevice(configuration.graphicDeviceOptions);
209
209
  var engine = new WebGLEngine(webCanvas, webGLGraphicDevice, configuration);
210
+ // @ts-ignore
210
211
  return engine._initialize(configuration);
211
212
  };
212
213
  _create_class(WebGLEngine, [
@@ -215,6 +216,7 @@ function _inherits(subClass, superClass) {
215
216
  get: /**
216
217
  * Web canvas.
217
218
  */ function get() {
219
+ // @ts-ignore
218
220
  return this._canvas;
219
221
  }
220
222
  }
@@ -1903,23 +1905,23 @@ exports.WebGLMode = void 0;
1903
1905
  };
1904
1906
  _proto.activeRenderTarget = function activeRenderTarget(renderTarget, viewport, mipLevel) {
1905
1907
  var gl = this._gl;
1908
+ var bufferWidth, bufferHeight;
1906
1909
  if (renderTarget) {
1907
1910
  var /** @ts-ignore */ _renderTarget__platformRenderTarget;
1908
1911
  (_renderTarget__platformRenderTarget = renderTarget._platformRenderTarget) == null ? void 0 : _renderTarget__platformRenderTarget._activeRenderTarget();
1909
- var width = renderTarget.width >> mipLevel;
1910
- var height = renderTarget.height >> mipLevel;
1911
- this.viewport(0, 0, width, height);
1912
- this.scissor(0, 0, width, height);
1912
+ bufferWidth = renderTarget.width >> mipLevel;
1913
+ bufferHeight = renderTarget.height >> mipLevel;
1913
1914
  } else {
1914
1915
  gl.bindFramebuffer(gl.FRAMEBUFFER, null);
1915
- var drawingBufferWidth = gl.drawingBufferWidth, drawingBufferHeight = gl.drawingBufferHeight;
1916
- var width1 = drawingBufferWidth * viewport.z;
1917
- var height1 = drawingBufferHeight * viewport.w;
1918
- var x = viewport.x * drawingBufferWidth;
1919
- var y = drawingBufferHeight - viewport.y * drawingBufferHeight - height1;
1920
- this.viewport(x, y, width1, height1);
1921
- this.scissor(x, y, width1, height1);
1922
- }
1916
+ bufferWidth = gl.drawingBufferWidth;
1917
+ bufferHeight = gl.drawingBufferHeight;
1918
+ }
1919
+ var width = bufferWidth * viewport.z;
1920
+ var height = bufferHeight * viewport.w;
1921
+ var x = viewport.x * bufferWidth;
1922
+ var y = bufferHeight - viewport.y * bufferHeight - height;
1923
+ this.viewport(x, y, width, height);
1924
+ this.scissor(x, y, width, height);
1923
1925
  };
1924
1926
  _proto.activeTexture = function activeTexture(textureID) {
1925
1927
  if (this._activeTextureID !== textureID) {