@luma.gl/webgl 9.0.27 → 9.0.28
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/index.cjs
CHANGED
|
@@ -5132,7 +5132,8 @@ var _WebGLDevice = class extends import_core27.Device {
|
|
|
5132
5132
|
throw new Error(`WebGL context already attached to device ${device.id}`);
|
|
5133
5133
|
}
|
|
5134
5134
|
const canvas = ((_b = props.gl) == null ? void 0 : _b.canvas) || props.canvas;
|
|
5135
|
-
|
|
5135
|
+
const autoResize = !props.gl;
|
|
5136
|
+
this.canvasContext = new WebGLCanvasContext(this, { ...props, autoResize, canvas });
|
|
5136
5137
|
this.lost = new Promise((resolve) => {
|
|
5137
5138
|
this._resolveContextLost = resolve;
|
|
5138
5139
|
});
|
|
@@ -5163,7 +5164,9 @@ var _WebGLDevice = class extends import_core27.Device {
|
|
|
5163
5164
|
if (this.props.initalizeFeatures) {
|
|
5164
5165
|
this.features.initializeFeatures();
|
|
5165
5166
|
}
|
|
5166
|
-
|
|
5167
|
+
if (autoResize) {
|
|
5168
|
+
this.canvasContext.resize();
|
|
5169
|
+
}
|
|
5167
5170
|
const { enable: enable2 = true, copyState = false } = props;
|
|
5168
5171
|
trackContextState(this.gl, {
|
|
5169
5172
|
enable: enable2,
|