babylonjs-gui 6.0.0 → 6.2.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.
package/babylon.gui.js CHANGED
@@ -1715,8 +1715,9 @@ var AdvancedDynamicTexture = /** @class */ (function (_super) {
1715
1715
  if (!scene) {
1716
1716
  return this;
1717
1717
  }
1718
+ var size = this.getSize();
1718
1719
  var data = this.serializeContent();
1719
- var clone = AdvancedDynamicTexture.CreateFullscreenUI(newName || "Clone of " + this.name, this.isForeground, scene, this.samplingMode);
1720
+ var clone = new AdvancedDynamicTexture(newName !== null && newName !== void 0 ? newName : "Clone of " + this.name, size.width, size.height, scene, !this.noMipmap, this.samplingMode);
1720
1721
  clone.parseSerializedObject(data);
1721
1722
  return clone;
1722
1723
  };
@@ -6716,6 +6717,8 @@ var Control = /** @class */ (function () {
6716
6717
  core_Misc_observable__WEBPACK_IMPORTED_MODULE_1__.SerializationHelper.Serialize(this, serializationObject);
6717
6718
  serializationObject.name = this.name;
6718
6719
  serializationObject.className = this.getClassName();
6720
+ // Call prepareFont to guarantee the font is properly set before serializing
6721
+ this._prepareFont();
6719
6722
  if (this._font) {
6720
6723
  serializationObject.fontFamily = this._fontFamily;
6721
6724
  serializationObject.fontSize = this.fontSize;