@babylonjs/gui 7.44.0 → 7.45.0
Sign up to get free protection for your applications and to get access to all the features.
- package/2D/controls/control.js +15 -0
- package/2D/controls/control.js.map +1 -1
- package/3D/controls/MRTK3/touchHolographicButton.js +10 -5
- package/3D/controls/MRTK3/touchHolographicButton.js.map +1 -1
- package/3D/controls/holographicBackplate.js +4 -2
- package/3D/controls/holographicBackplate.js.map +1 -1
- package/3D/controls/holographicSlate.js +5 -3
- package/3D/controls/holographicSlate.js.map +1 -1
- package/3D/controls/nearMenu.js +4 -2
- package/3D/controls/nearMenu.js.map +1 -1
- package/3D/controls/slider3D.js +4 -2
- package/3D/controls/slider3D.js.map +1 -1
- package/3D/controls/touchHolographicButton.js +4 -2
- package/3D/controls/touchHolographicButton.js.map +1 -1
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +7 -4
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
- package/3D/materials/fluentButton/fluentButtonMaterial.js +4 -2
- package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlBackplateMaterial.js +4 -2
- package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js +4 -2
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +4 -2
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
- package/package.json +2 -2
package/2D/controls/control.js
CHANGED
@@ -2104,6 +2104,16 @@ export class Control {
|
|
2104
2104
|
if (!this.isSerializable && !force) {
|
2105
2105
|
return;
|
2106
2106
|
}
|
2107
|
+
let idealWidth = 0;
|
2108
|
+
let idealHeight = 0;
|
2109
|
+
// the host's ideal width and height are influencing the serialization, as they are used in getValue() of ValueAndUnit.
|
2110
|
+
// for a proper serialization, we need to temporarily set them to 0 and re-set them back afterwards.
|
2111
|
+
if (this.host) {
|
2112
|
+
idealHeight = this.host.idealHeight;
|
2113
|
+
idealWidth = this.host.idealWidth;
|
2114
|
+
this.host.idealWidth = 0;
|
2115
|
+
this.host.idealHeight = 0;
|
2116
|
+
}
|
2107
2117
|
SerializationHelper.Serialize(this, serializationObject);
|
2108
2118
|
serializationObject.name = this.name;
|
2109
2119
|
serializationObject.className = this.getClassName();
|
@@ -2129,6 +2139,11 @@ export class Control {
|
|
2129
2139
|
}
|
2130
2140
|
// Animations
|
2131
2141
|
SerializationHelper.AppendSerializedAnimations(this, serializationObject);
|
2142
|
+
// re-set the ideal width and height
|
2143
|
+
if (this.host) {
|
2144
|
+
this.host.idealWidth = idealWidth;
|
2145
|
+
this.host.idealHeight = idealHeight;
|
2146
|
+
}
|
2132
2147
|
}
|
2133
2148
|
/**
|
2134
2149
|
* @internal
|