@babylonjs/core 6.5.1 → 6.6.0

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.
@@ -34,13 +34,13 @@ export class ThinEngine {
34
34
  */
35
35
  // Not mixed with Version for tooling purpose.
36
36
  static get NpmPackage() {
37
- return "babylonjs@6.5.1";
37
+ return "babylonjs@6.6.0";
38
38
  }
39
39
  /**
40
40
  * Returns the current version of the framework
41
41
  */
42
42
  static get Version() {
43
- return "6.5.1";
43
+ return "6.6.0";
44
44
  }
45
45
  /**
46
46
  * Returns a string describing the current engine
@@ -1280,15 +1280,16 @@ export class ThinEngine {
1280
1280
  resize(forceSetSize = false) {
1281
1281
  let width;
1282
1282
  let height;
1283
- // Requery hardware scaling level to handle zoomed-in resizing.
1283
+ // Re-query hardware scaling level to handle zoomed-in resizing.
1284
1284
  if (this.adaptToDeviceRatio) {
1285
1285
  const devicePixelRatio = IsWindowObjectExist() ? window.devicePixelRatio || 1.0 : 1.0;
1286
1286
  const changeRatio = this._lastDevicePixelRatio / devicePixelRatio;
1287
1287
  this._lastDevicePixelRatio = devicePixelRatio;
1288
1288
  this._hardwareScalingLevel *= changeRatio;
1289
1289
  }
1290
- if (IsWindowObjectExist()) {
1291
- if (this._renderingCanvas) {
1290
+ if (IsWindowObjectExist() && IsDocumentAvailable()) {
1291
+ // make sure it is a Node object, and is a part of the document.
1292
+ if (this._renderingCanvas && this._renderingCanvas.nodeType && document.body.contains(this._renderingCanvas)) {
1292
1293
  const boundingRect = this._renderingCanvas.getBoundingClientRect
1293
1294
  ? this._renderingCanvas.getBoundingClientRect()
1294
1295
  : {
@@ -1299,6 +1300,10 @@ export class ThinEngine {
1299
1300
  width = this._renderingCanvas.clientWidth || boundingRect.width;
1300
1301
  height = this._renderingCanvas.clientHeight || boundingRect.height;
1301
1302
  }
1303
+ else if (this._renderingCanvas) {
1304
+ width = this._renderingCanvas.width;
1305
+ height = this._renderingCanvas.height;
1306
+ }
1302
1307
  else {
1303
1308
  width = window.innerWidth;
1304
1309
  height = window.innerHeight;