@babylonjs/gui 5.20.0 → 5.22.1

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.
Files changed (178) hide show
  1. package/2D/adtInstrumentation.js +70 -90
  2. package/2D/adtInstrumentation.js.map +1 -1
  3. package/2D/advancedDynamicTexture.d.ts +14 -0
  4. package/2D/advancedDynamicTexture.js +574 -620
  5. package/2D/advancedDynamicTexture.js.map +1 -1
  6. package/2D/controls/button.js +76 -90
  7. package/2D/controls/button.js.map +1 -1
  8. package/2D/controls/checkbox.js +86 -106
  9. package/2D/controls/checkbox.js.map +1 -1
  10. package/2D/controls/colorpicker.js +395 -415
  11. package/2D/controls/colorpicker.js.map +1 -1
  12. package/2D/controls/container.js +187 -230
  13. package/2D/controls/container.js.map +1 -1
  14. package/2D/controls/control.js +1073 -1353
  15. package/2D/controls/control.js.map +1 -1
  16. package/2D/controls/displayGrid.js +152 -196
  17. package/2D/controls/displayGrid.js.map +1 -1
  18. package/2D/controls/ellipse.js +32 -40
  19. package/2D/controls/ellipse.js.map +1 -1
  20. package/2D/controls/focusableButton.js +30 -35
  21. package/2D/controls/focusableButton.js.map +1 -1
  22. package/2D/controls/grid.js +172 -212
  23. package/2D/controls/grid.js.map +1 -1
  24. package/2D/controls/image.js +489 -592
  25. package/2D/controls/image.js.map +1 -1
  26. package/2D/controls/inputPassword.js +9 -16
  27. package/2D/controls/inputPassword.js.map +1 -1
  28. package/2D/controls/inputText.js +380 -467
  29. package/2D/controls/inputText.js.map +1 -1
  30. package/2D/controls/inputTextArea.js +234 -273
  31. package/2D/controls/inputTextArea.js.map +1 -1
  32. package/2D/controls/line.js +147 -198
  33. package/2D/controls/line.js.map +1 -1
  34. package/2D/controls/multiLine.js +87 -113
  35. package/2D/controls/multiLine.js.map +1 -1
  36. package/2D/controls/radioButton.js +106 -127
  37. package/2D/controls/radioButton.js.map +1 -1
  38. package/2D/controls/rectangle.js +60 -72
  39. package/2D/controls/rectangle.js.map +1 -1
  40. package/2D/controls/scrollViewers/scrollViewer.js +439 -543
  41. package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
  42. package/2D/controls/scrollViewers/scrollViewerWindow.js +99 -118
  43. package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -1
  44. package/2D/controls/selector.js +241 -329
  45. package/2D/controls/selector.js.map +1 -1
  46. package/2D/controls/sliders/baseSlider.js +182 -230
  47. package/2D/controls/sliders/baseSlider.js.map +1 -1
  48. package/2D/controls/sliders/imageBasedSlider.js +86 -109
  49. package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
  50. package/2D/controls/sliders/imageScrollBar.js +148 -178
  51. package/2D/controls/sliders/imageScrollBar.js.map +1 -1
  52. package/2D/controls/sliders/scrollBar.js +64 -80
  53. package/2D/controls/sliders/scrollBar.js.map +1 -1
  54. package/2D/controls/sliders/slider.js +91 -115
  55. package/2D/controls/sliders/slider.js.map +1 -1
  56. package/2D/controls/stackPanel.js +114 -135
  57. package/2D/controls/stackPanel.js.map +1 -1
  58. package/2D/controls/statics.js +5 -5
  59. package/2D/controls/statics.js.map +1 -1
  60. package/2D/controls/textBlock.js +322 -384
  61. package/2D/controls/textBlock.js.map +1 -1
  62. package/2D/controls/textWrapper.js +27 -41
  63. package/2D/controls/textWrapper.js.map +1 -1
  64. package/2D/controls/toggleButton.js +105 -121
  65. package/2D/controls/toggleButton.js.map +1 -1
  66. package/2D/controls/virtualKeyboard.js +101 -123
  67. package/2D/controls/virtualKeyboard.js.map +1 -1
  68. package/2D/math2D.js +62 -70
  69. package/2D/math2D.js.map +1 -1
  70. package/2D/measure.js +30 -32
  71. package/2D/measure.js.map +1 -1
  72. package/2D/multiLinePoint.js +71 -89
  73. package/2D/multiLinePoint.js.map +1 -1
  74. package/2D/style.js +55 -73
  75. package/2D/style.js.map +1 -1
  76. package/2D/valueAndUnit.js +71 -104
  77. package/2D/valueAndUnit.js.map +1 -1
  78. package/2D/xmlLoader.js +70 -84
  79. package/2D/xmlLoader.js.map +1 -1
  80. package/3D/behaviors/defaultBehavior.js +40 -59
  81. package/3D/behaviors/defaultBehavior.js.map +1 -1
  82. package/3D/controls/abstractButton3D.js +8 -12
  83. package/3D/controls/abstractButton3D.js.map +1 -1
  84. package/3D/controls/button3D.js +30 -35
  85. package/3D/controls/button3D.js.map +1 -1
  86. package/3D/controls/container3D.js +57 -71
  87. package/3D/controls/container3D.js.map +1 -1
  88. package/3D/controls/contentDisplay3D.js +47 -60
  89. package/3D/controls/contentDisplay3D.js.map +1 -1
  90. package/3D/controls/control3D.js +123 -158
  91. package/3D/controls/control3D.js.map +1 -1
  92. package/3D/controls/cylinderPanel.js +28 -38
  93. package/3D/controls/cylinderPanel.js.map +1 -1
  94. package/3D/controls/handMenu.js +20 -29
  95. package/3D/controls/handMenu.js.map +1 -1
  96. package/3D/controls/holographicBackplate.js +52 -72
  97. package/3D/controls/holographicBackplate.js.map +1 -1
  98. package/3D/controls/holographicButton.js +160 -200
  99. package/3D/controls/holographicButton.js.map +1 -1
  100. package/3D/controls/holographicSlate.js +176 -206
  101. package/3D/controls/holographicSlate.js.map +1 -1
  102. package/3D/controls/meshButton3D.js +24 -30
  103. package/3D/controls/meshButton3D.js.map +1 -1
  104. package/3D/controls/nearMenu.js +57 -71
  105. package/3D/controls/nearMenu.js.map +1 -1
  106. package/3D/controls/planePanel.js +6 -13
  107. package/3D/controls/planePanel.js.map +1 -1
  108. package/3D/controls/scatterPanel.js +43 -54
  109. package/3D/controls/scatterPanel.js.map +1 -1
  110. package/3D/controls/slider3D.js +168 -222
  111. package/3D/controls/slider3D.js.map +1 -1
  112. package/3D/controls/spherePanel.js +29 -39
  113. package/3D/controls/spherePanel.js.map +1 -1
  114. package/3D/controls/stackPanel3D.js +36 -49
  115. package/3D/controls/stackPanel3D.js.map +1 -1
  116. package/3D/controls/touchButton3D.js +126 -154
  117. package/3D/controls/touchButton3D.js.map +1 -1
  118. package/3D/controls/touchHolographicButton.js +223 -272
  119. package/3D/controls/touchHolographicButton.js.map +1 -1
  120. package/3D/controls/touchHolographicMenu.js +55 -66
  121. package/3D/controls/touchHolographicMenu.js.map +1 -1
  122. package/3D/controls/touchMeshButton3D.js +24 -30
  123. package/3D/controls/touchMeshButton3D.js.map +1 -1
  124. package/3D/controls/volumeBasedPanel.js +85 -107
  125. package/3D/controls/volumeBasedPanel.js.map +1 -1
  126. package/3D/gizmos/gizmoHandle.js +68 -103
  127. package/3D/gizmos/gizmoHandle.js.map +1 -1
  128. package/3D/gizmos/slateGizmo.js +165 -182
  129. package/3D/gizmos/slateGizmo.js.map +1 -1
  130. package/3D/gui3DManager.js +76 -101
  131. package/3D/gui3DManager.js.map +1 -1
  132. package/3D/materials/fluent/fluentMaterial.js +110 -119
  133. package/3D/materials/fluent/fluentMaterial.js.map +1 -1
  134. package/3D/materials/fluent/shaders/fluent.fragment.js +20 -3
  135. package/3D/materials/fluent/shaders/fluent.fragment.js.map +1 -1
  136. package/3D/materials/fluent/shaders/fluent.vertex.js +11 -3
  137. package/3D/materials/fluent/shaders/fluent.vertex.js.map +1 -1
  138. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +168 -177
  139. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
  140. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js +9 -3
  141. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js.map +1 -1
  142. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js +15 -3
  143. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js.map +1 -1
  144. package/3D/materials/fluentButton/fluentButtonMaterial.js +205 -213
  145. package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
  146. package/3D/materials/fluentButton/shaders/fluentButton.fragment.js +6 -3
  147. package/3D/materials/fluentButton/shaders/fluentButton.fragment.js.map +1 -1
  148. package/3D/materials/fluentButton/shaders/fluentButton.vertex.js +6 -3
  149. package/3D/materials/fluentButton/shaders/fluentButton.vertex.js.map +1 -1
  150. package/3D/materials/handle/handleMaterial.js +56 -69
  151. package/3D/materials/handle/handleMaterial.js.map +1 -1
  152. package/3D/materials/handle/shaders/handle.fragment.js +3 -3
  153. package/3D/materials/handle/shaders/handle.fragment.js.map +1 -1
  154. package/3D/materials/handle/shaders/handle.vertex.js +3 -3
  155. package/3D/materials/handle/shaders/handle.vertex.js.map +1 -1
  156. package/3D/materials/mrdl/mrdlBackplateMaterial.js +158 -166
  157. package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
  158. package/3D/materials/mrdl/mrdlSliderBarMaterial.js +322 -330
  159. package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
  160. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +322 -330
  161. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
  162. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js +9 -3
  163. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js.map +1 -1
  164. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js +6 -3
  165. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js.map +1 -1
  166. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js +24 -3
  167. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js.map +1 -1
  168. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js +12 -3
  169. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js.map +1 -1
  170. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js +24 -3
  171. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js.map +1 -1
  172. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js +12 -3
  173. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js.map +1 -1
  174. package/3D/vector3WithInfo.js +6 -12
  175. package/3D/vector3WithInfo.js.map +1 -1
  176. package/legacy/legacy.js +1 -1
  177. package/legacy/legacy.js.map +1 -1
  178. package/package.json +3 -6
@@ -1,4 +1,4 @@
1
- import { __decorate } from "tslib";
1
+ import { __decorate } from "@babylonjs/core/tslib.es6.js";
2
2
  import { Observable } from "@babylonjs/core/Misc/observable.js";
3
3
  import { Vector2, Vector3, Matrix } from "@babylonjs/core/Maths/math.vector.js";
4
4
  import { PointerEventTypes } from "@babylonjs/core/Events/pointerEvents.js";
@@ -14,13 +14,13 @@ import { EngineStore } from "@babylonjs/core/Engines/engineStore.js";
14
14
  * Root class used for all 2D controls
15
15
  * @see https://doc.babylonjs.com/how_to/gui#controls
16
16
  */
17
- var Control = /** @class */ (function () {
17
+ export class Control {
18
18
  // Functions
19
19
  /**
20
20
  * Creates a new control
21
21
  * @param name defines the name of the control
22
22
  */
23
- function Control(
23
+ constructor(
24
24
  /** defines the name of the control */
25
25
  name) {
26
26
  this.name = name;
@@ -195,1006 +195,752 @@ var Control = /** @class */ (function () {
195
195
  this._fixedRatioMasterIsWidth = true;
196
196
  this._tmpMeasureA = new Measure(0, 0, 0, 0);
197
197
  }
198
- Object.defineProperty(Control.prototype, "isReadOnly", {
199
- /**
200
- * Gets or sets a boolean indicating if the control is readonly (default: false).
201
- * A readonly control will still raise pointer events but will not react to them
202
- */
203
- get: function () {
204
- return this._isReadOnly;
205
- },
206
- set: function (value) {
207
- this._isReadOnly = value;
208
- },
209
- enumerable: false,
210
- configurable: true
211
- });
212
- Object.defineProperty(Control.prototype, "transformedMeasure", {
213
- /**
214
- * Gets the transformed measure, that is the bounding box of the control after applying all transformations
215
- */
216
- get: function () {
217
- return this._evaluatedMeasure;
218
- },
219
- enumerable: false,
220
- configurable: true
221
- });
222
- Object.defineProperty(Control.prototype, "shadowOffsetX", {
223
- /** Gets or sets a value indicating the offset to apply on X axis to render the shadow */
224
- get: function () {
225
- return this._shadowOffsetX;
226
- },
227
- set: function (value) {
228
- if (this._shadowOffsetX === value) {
229
- return;
230
- }
231
- this._shadowOffsetX = value;
232
- this._markAsDirty();
233
- },
234
- enumerable: false,
235
- configurable: true
236
- });
237
- Object.defineProperty(Control.prototype, "shadowOffsetY", {
238
- /** Gets or sets a value indicating the offset to apply on Y axis to render the shadow */
239
- get: function () {
240
- return this._shadowOffsetY;
241
- },
242
- set: function (value) {
243
- if (this._shadowOffsetY === value) {
244
- return;
245
- }
246
- this._shadowOffsetY = value;
247
- this._markAsDirty();
248
- },
249
- enumerable: false,
250
- configurable: true
251
- });
252
- Object.defineProperty(Control.prototype, "shadowBlur", {
253
- /** Gets or sets a value indicating the amount of blur to use to render the shadow */
254
- get: function () {
255
- return this._shadowBlur;
256
- },
257
- set: function (value) {
258
- if (this._shadowBlur === value) {
259
- return;
260
- }
261
- this._previousShadowBlur = this._shadowBlur;
262
- this._shadowBlur = value;
263
- this._markAsDirty();
264
- },
265
- enumerable: false,
266
- configurable: true
267
- });
268
- Object.defineProperty(Control.prototype, "shadowColor", {
269
- /** Gets or sets a value indicating the color of the shadow (black by default ie. "#000") */
270
- get: function () {
271
- return this._shadowColor;
272
- },
273
- set: function (value) {
274
- if (this._shadowColor === value) {
275
- return;
276
- }
277
- this._shadowColor = value;
278
- this._markAsDirty();
279
- },
280
- enumerable: false,
281
- configurable: true
282
- });
283
- Object.defineProperty(Control.prototype, "typeName", {
284
- // Properties
285
- /** Gets the control type name */
286
- get: function () {
287
- return this._getTypeName();
288
- },
289
- enumerable: false,
290
- configurable: true
291
- });
198
+ /**
199
+ * Gets or sets a boolean indicating if the control is readonly (default: false).
200
+ * A readonly control will still raise pointer events but will not react to them
201
+ */
202
+ get isReadOnly() {
203
+ return this._isReadOnly;
204
+ }
205
+ set isReadOnly(value) {
206
+ this._isReadOnly = value;
207
+ }
208
+ /**
209
+ * Gets the transformed measure, that is the bounding box of the control after applying all transformations
210
+ */
211
+ get transformedMeasure() {
212
+ return this._evaluatedMeasure;
213
+ }
214
+ /** Gets or sets a value indicating the offset to apply on X axis to render the shadow */
215
+ get shadowOffsetX() {
216
+ return this._shadowOffsetX;
217
+ }
218
+ set shadowOffsetX(value) {
219
+ if (this._shadowOffsetX === value) {
220
+ return;
221
+ }
222
+ this._shadowOffsetX = value;
223
+ this._markAsDirty();
224
+ }
225
+ /** Gets or sets a value indicating the offset to apply on Y axis to render the shadow */
226
+ get shadowOffsetY() {
227
+ return this._shadowOffsetY;
228
+ }
229
+ set shadowOffsetY(value) {
230
+ if (this._shadowOffsetY === value) {
231
+ return;
232
+ }
233
+ this._shadowOffsetY = value;
234
+ this._markAsDirty();
235
+ }
236
+ /** Gets or sets a value indicating the amount of blur to use to render the shadow */
237
+ get shadowBlur() {
238
+ return this._shadowBlur;
239
+ }
240
+ set shadowBlur(value) {
241
+ if (this._shadowBlur === value) {
242
+ return;
243
+ }
244
+ this._previousShadowBlur = this._shadowBlur;
245
+ this._shadowBlur = value;
246
+ this._markAsDirty();
247
+ }
248
+ /** Gets or sets a value indicating the color of the shadow (black by default ie. "#000") */
249
+ get shadowColor() {
250
+ return this._shadowColor;
251
+ }
252
+ set shadowColor(value) {
253
+ if (this._shadowColor === value) {
254
+ return;
255
+ }
256
+ this._shadowColor = value;
257
+ this._markAsDirty();
258
+ }
259
+ // Properties
260
+ /** Gets the control type name */
261
+ get typeName() {
262
+ return this._getTypeName();
263
+ }
292
264
  /**
293
265
  * Get the current class name of the control.
294
266
  * @returns current class name
295
267
  */
296
- Control.prototype.getClassName = function () {
268
+ getClassName() {
297
269
  return this._getTypeName();
298
- };
299
- Object.defineProperty(Control.prototype, "host", {
300
- /**
301
- * Get the hosting AdvancedDynamicTexture
302
- */
303
- get: function () {
304
- return this._host;
305
- },
306
- enumerable: false,
307
- configurable: true
308
- });
309
- Object.defineProperty(Control.prototype, "fontOffset", {
310
- /** Gets or set information about font offsets (used to render and align text) */
311
- get: function () {
312
- return this._fontOffset;
313
- },
314
- set: function (offset) {
315
- this._fontOffset = offset;
316
- },
317
- enumerable: false,
318
- configurable: true
319
- });
320
- Object.defineProperty(Control.prototype, "alpha", {
321
- /** Gets or sets alpha value for the control (1 means opaque and 0 means entirely transparent) */
322
- get: function () {
323
- return this._alpha;
324
- },
325
- set: function (value) {
326
- if (this._alpha === value) {
327
- return;
328
- }
329
- this._alphaSet = true;
330
- this._alpha = value;
331
- this._markAsDirty();
332
- },
333
- enumerable: false,
334
- configurable: true
335
- });
336
- Object.defineProperty(Control.prototype, "highlightLineWidth", {
337
- /**
338
- * Gets or sets a number indicating size of stroke we want to highlight the control with (mostly for debugging purpose)
339
- */
340
- get: function () {
341
- return this._highlightLineWidth;
342
- },
343
- set: function (value) {
344
- if (this._highlightLineWidth === value) {
345
- return;
346
- }
347
- this._highlightLineWidth = value;
348
- this._markAsDirty();
349
- },
350
- enumerable: false,
351
- configurable: true
352
- });
353
- Object.defineProperty(Control.prototype, "isHighlighted", {
354
- /**
355
- * Gets or sets a boolean indicating that we want to highlight the control (mostly for debugging purpose)
356
- */
357
- get: function () {
358
- return this._isHighlighted;
359
- },
360
- set: function (value) {
361
- if (this._isHighlighted === value) {
362
- return;
363
- }
364
- this._isHighlighted = value;
365
- this._markAsDirty();
366
- },
367
- enumerable: false,
368
- configurable: true
369
- });
370
- Object.defineProperty(Control.prototype, "highlightColor", {
371
- /**
372
- * Gets or sets a string defining the color to use for highlighting this control
373
- */
374
- get: function () {
375
- return this._highlightColor;
376
- },
377
- set: function (value) {
378
- if (this._highlightColor === value) {
379
- return;
380
- }
381
- this._highlightColor = value;
382
- this._markAsDirty();
383
- },
384
- enumerable: false,
385
- configurable: true
386
- });
387
- Object.defineProperty(Control.prototype, "scaleX", {
388
- /** Gets or sets a value indicating the scale factor on X axis (1 by default)
389
- * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
390
- */
391
- get: function () {
392
- return this._scaleX;
393
- },
394
- set: function (value) {
395
- if (this._scaleX === value) {
396
- return;
397
- }
398
- this._scaleX = value;
399
- this._markAsDirty();
400
- this._markMatrixAsDirty();
401
- },
402
- enumerable: false,
403
- configurable: true
404
- });
405
- Object.defineProperty(Control.prototype, "scaleY", {
406
- /** Gets or sets a value indicating the scale factor on Y axis (1 by default)
407
- * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
408
- */
409
- get: function () {
410
- return this._scaleY;
411
- },
412
- set: function (value) {
413
- if (this._scaleY === value) {
414
- return;
415
- }
416
- this._scaleY = value;
270
+ }
271
+ /**
272
+ * Get the hosting AdvancedDynamicTexture
273
+ */
274
+ get host() {
275
+ return this._host;
276
+ }
277
+ /** Gets or set information about font offsets (used to render and align text) */
278
+ get fontOffset() {
279
+ return this._fontOffset;
280
+ }
281
+ set fontOffset(offset) {
282
+ this._fontOffset = offset;
283
+ }
284
+ /** Gets or sets alpha value for the control (1 means opaque and 0 means entirely transparent) */
285
+ get alpha() {
286
+ return this._alpha;
287
+ }
288
+ set alpha(value) {
289
+ if (this._alpha === value) {
290
+ return;
291
+ }
292
+ this._alphaSet = true;
293
+ this._alpha = value;
294
+ this._markAsDirty();
295
+ }
296
+ /**
297
+ * Gets or sets a number indicating size of stroke we want to highlight the control with (mostly for debugging purpose)
298
+ */
299
+ get highlightLineWidth() {
300
+ return this._highlightLineWidth;
301
+ }
302
+ set highlightLineWidth(value) {
303
+ if (this._highlightLineWidth === value) {
304
+ return;
305
+ }
306
+ this._highlightLineWidth = value;
307
+ this._markAsDirty();
308
+ }
309
+ /**
310
+ * Gets or sets a boolean indicating that we want to highlight the control (mostly for debugging purpose)
311
+ */
312
+ get isHighlighted() {
313
+ return this._isHighlighted;
314
+ }
315
+ set isHighlighted(value) {
316
+ if (this._isHighlighted === value) {
317
+ return;
318
+ }
319
+ this._isHighlighted = value;
320
+ this._markAsDirty();
321
+ }
322
+ /**
323
+ * Gets or sets a string defining the color to use for highlighting this control
324
+ */
325
+ get highlightColor() {
326
+ return this._highlightColor;
327
+ }
328
+ set highlightColor(value) {
329
+ if (this._highlightColor === value) {
330
+ return;
331
+ }
332
+ this._highlightColor = value;
333
+ this._markAsDirty();
334
+ }
335
+ /** Gets or sets a value indicating the scale factor on X axis (1 by default)
336
+ * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
337
+ */
338
+ get scaleX() {
339
+ return this._scaleX;
340
+ }
341
+ set scaleX(value) {
342
+ if (this._scaleX === value) {
343
+ return;
344
+ }
345
+ this._scaleX = value;
346
+ this._markAsDirty();
347
+ this._markMatrixAsDirty();
348
+ }
349
+ /** Gets or sets a value indicating the scale factor on Y axis (1 by default)
350
+ * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
351
+ */
352
+ get scaleY() {
353
+ return this._scaleY;
354
+ }
355
+ set scaleY(value) {
356
+ if (this._scaleY === value) {
357
+ return;
358
+ }
359
+ this._scaleY = value;
360
+ this._markAsDirty();
361
+ this._markMatrixAsDirty();
362
+ }
363
+ /** Gets or sets the rotation angle (0 by default)
364
+ * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
365
+ */
366
+ get rotation() {
367
+ return this._rotation;
368
+ }
369
+ set rotation(value) {
370
+ if (this._rotation === value) {
371
+ return;
372
+ }
373
+ this._rotation = value;
374
+ this._markAsDirty();
375
+ this._markMatrixAsDirty();
376
+ }
377
+ /** Gets or sets the transformation center on Y axis (0 by default)
378
+ * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
379
+ */
380
+ get transformCenterY() {
381
+ return this._transformCenterY;
382
+ }
383
+ set transformCenterY(value) {
384
+ if (this._transformCenterY === value) {
385
+ return;
386
+ }
387
+ this._transformCenterY = value;
388
+ this._markAsDirty();
389
+ this._markMatrixAsDirty();
390
+ }
391
+ /** Gets or sets the transformation center on X axis (0 by default)
392
+ * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
393
+ */
394
+ get transformCenterX() {
395
+ return this._transformCenterX;
396
+ }
397
+ set transformCenterX(value) {
398
+ if (this._transformCenterX === value) {
399
+ return;
400
+ }
401
+ this._transformCenterX = value;
402
+ this._markAsDirty();
403
+ this._markMatrixAsDirty();
404
+ }
405
+ /**
406
+ * Gets or sets the horizontal alignment
407
+ * @see https://doc.babylonjs.com/how_to/gui#alignments
408
+ */
409
+ get horizontalAlignment() {
410
+ return this._horizontalAlignment;
411
+ }
412
+ set horizontalAlignment(value) {
413
+ if (this._horizontalAlignment === value) {
414
+ return;
415
+ }
416
+ this._horizontalAlignment = value;
417
+ this._markAsDirty();
418
+ }
419
+ /**
420
+ * Gets or sets the vertical alignment
421
+ * @see https://doc.babylonjs.com/how_to/gui#alignments
422
+ */
423
+ get verticalAlignment() {
424
+ return this._verticalAlignment;
425
+ }
426
+ set verticalAlignment(value) {
427
+ if (this._verticalAlignment === value) {
428
+ return;
429
+ }
430
+ this._verticalAlignment = value;
431
+ this._markAsDirty();
432
+ }
433
+ /**
434
+ * Gets or sets control width
435
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
436
+ */
437
+ get width() {
438
+ return this._width.toString(this._host);
439
+ }
440
+ set width(value) {
441
+ this._fixedRatioMasterIsWidth = true;
442
+ if (this._width.toString(this._host) === value) {
443
+ return;
444
+ }
445
+ if (this._width.fromString(value)) {
417
446
  this._markAsDirty();
418
- this._markMatrixAsDirty();
419
- },
420
- enumerable: false,
421
- configurable: true
422
- });
423
- Object.defineProperty(Control.prototype, "rotation", {
424
- /** Gets or sets the rotation angle (0 by default)
425
- * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
426
- */
427
- get: function () {
428
- return this._rotation;
429
- },
430
- set: function (value) {
431
- if (this._rotation === value) {
432
- return;
433
- }
434
- this._rotation = value;
447
+ }
448
+ }
449
+ /**
450
+ * Gets or sets the control width in pixel
451
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
452
+ */
453
+ get widthInPixels() {
454
+ return this._width.getValueInPixel(this._host, this._cachedParentMeasure.width);
455
+ }
456
+ set widthInPixels(value) {
457
+ if (isNaN(value)) {
458
+ return;
459
+ }
460
+ this._fixedRatioMasterIsWidth = true;
461
+ this.width = value + "px";
462
+ }
463
+ /**
464
+ * Gets or sets control height
465
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
466
+ */
467
+ get height() {
468
+ return this._height.toString(this._host);
469
+ }
470
+ set height(value) {
471
+ this._fixedRatioMasterIsWidth = false;
472
+ if (this._height.toString(this._host) === value) {
473
+ return;
474
+ }
475
+ if (this._height.fromString(value)) {
435
476
  this._markAsDirty();
436
- this._markMatrixAsDirty();
437
- },
438
- enumerable: false,
439
- configurable: true
440
- });
441
- Object.defineProperty(Control.prototype, "transformCenterY", {
442
- /** Gets or sets the transformation center on Y axis (0 by default)
443
- * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
444
- */
445
- get: function () {
446
- return this._transformCenterY;
447
- },
448
- set: function (value) {
449
- if (this._transformCenterY === value) {
450
- return;
451
- }
452
- this._transformCenterY = value;
477
+ }
478
+ }
479
+ /**
480
+ * Gets or sets control height in pixel
481
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
482
+ */
483
+ get heightInPixels() {
484
+ return this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);
485
+ }
486
+ set heightInPixels(value) {
487
+ if (isNaN(value)) {
488
+ return;
489
+ }
490
+ this._fixedRatioMasterIsWidth = false;
491
+ this.height = value + "px";
492
+ }
493
+ /** Gets or set font family */
494
+ get fontFamily() {
495
+ return this._fontFamily;
496
+ }
497
+ set fontFamily(value) {
498
+ if (this._fontFamily === value) {
499
+ return;
500
+ }
501
+ this._fontFamily = value;
502
+ this._resetFontCache();
503
+ }
504
+ /** Gets or sets font style */
505
+ get fontStyle() {
506
+ return this._fontStyle;
507
+ }
508
+ set fontStyle(value) {
509
+ if (this._fontStyle === value) {
510
+ return;
511
+ }
512
+ this._fontStyle = value;
513
+ this._resetFontCache();
514
+ }
515
+ /** Gets or sets font weight */
516
+ get fontWeight() {
517
+ return this._fontWeight;
518
+ }
519
+ set fontWeight(value) {
520
+ if (this._fontWeight === value) {
521
+ return;
522
+ }
523
+ this._fontWeight = value;
524
+ this._resetFontCache();
525
+ }
526
+ /**
527
+ * Gets or sets style
528
+ * @see https://doc.babylonjs.com/how_to/gui#styles
529
+ */
530
+ get style() {
531
+ return this._style;
532
+ }
533
+ set style(value) {
534
+ if (this._style) {
535
+ this._style.onChangedObservable.remove(this._styleObserver);
536
+ this._styleObserver = null;
537
+ }
538
+ this._style = value;
539
+ if (this._style) {
540
+ this._styleObserver = this._style.onChangedObservable.add(() => {
541
+ this._markAsDirty();
542
+ this._resetFontCache();
543
+ });
544
+ }
545
+ this._markAsDirty();
546
+ this._resetFontCache();
547
+ }
548
+ /** @hidden */
549
+ get _isFontSizeInPercentage() {
550
+ return this._fontSize.isPercentage;
551
+ }
552
+ /** Gets or sets font size in pixels */
553
+ get fontSizeInPixels() {
554
+ const fontSizeToUse = this._style ? this._style._fontSize : this._fontSize;
555
+ if (fontSizeToUse.isPixel) {
556
+ return fontSizeToUse.getValue(this._host);
557
+ }
558
+ return fontSizeToUse.getValueInPixel(this._host, this._tempParentMeasure.height || this._cachedParentMeasure.height);
559
+ }
560
+ set fontSizeInPixels(value) {
561
+ if (isNaN(value)) {
562
+ return;
563
+ }
564
+ this.fontSize = value + "px";
565
+ }
566
+ /** Gets or sets font size */
567
+ get fontSize() {
568
+ return this._fontSize.toString(this._host);
569
+ }
570
+ set fontSize(value) {
571
+ if (this._fontSize.toString(this._host) === value) {
572
+ return;
573
+ }
574
+ if (this._fontSize.fromString(value)) {
453
575
  this._markAsDirty();
454
- this._markMatrixAsDirty();
455
- },
456
- enumerable: false,
457
- configurable: true
458
- });
459
- Object.defineProperty(Control.prototype, "transformCenterX", {
460
- /** Gets or sets the transformation center on X axis (0 by default)
461
- * @see https://doc.babylonjs.com/how_to/gui#rotation-and-scaling
462
- */
463
- get: function () {
464
- return this._transformCenterX;
465
- },
466
- set: function (value) {
467
- if (this._transformCenterX === value) {
468
- return;
469
- }
470
- this._transformCenterX = value;
576
+ this._resetFontCache();
577
+ }
578
+ }
579
+ /** Gets or sets foreground color */
580
+ get color() {
581
+ return this._color;
582
+ }
583
+ set color(value) {
584
+ if (this._color === value) {
585
+ return;
586
+ }
587
+ this._color = value;
588
+ this._markAsDirty();
589
+ }
590
+ /** Gets or sets z index which is used to reorder controls on the z axis */
591
+ get zIndex() {
592
+ return this._zIndex;
593
+ }
594
+ set zIndex(value) {
595
+ if (this.zIndex === value) {
596
+ return;
597
+ }
598
+ this._zIndex = value;
599
+ if (this.parent) {
600
+ this.parent._reOrderControl(this);
601
+ }
602
+ }
603
+ /** Gets or sets a boolean indicating if the control can be rendered */
604
+ get notRenderable() {
605
+ return this._doNotRender;
606
+ }
607
+ set notRenderable(value) {
608
+ if (this._doNotRender === value) {
609
+ return;
610
+ }
611
+ this._doNotRender = value;
612
+ this._markAsDirty();
613
+ }
614
+ /** Gets or sets a boolean indicating if the control is visible */
615
+ get isVisible() {
616
+ return this._isVisible;
617
+ }
618
+ set isVisible(value) {
619
+ if (this._isVisible === value) {
620
+ return;
621
+ }
622
+ this._isVisible = value;
623
+ this._markAsDirty(true);
624
+ }
625
+ /** Gets a boolean indicating that the control needs to update its rendering */
626
+ get isDirty() {
627
+ return this._isDirty;
628
+ }
629
+ /**
630
+ * Gets the current linked mesh (or null if none)
631
+ */
632
+ get linkedMesh() {
633
+ return this._linkedMesh;
634
+ }
635
+ /**
636
+ * Gets or sets a value indicating the padding should work like in CSS.
637
+ * Basically, it will add the padding amount on each side of the parent control for its children.
638
+ */
639
+ get descendantsOnlyPadding() {
640
+ return this._descendantsOnlyPadding;
641
+ }
642
+ set descendantsOnlyPadding(value) {
643
+ if (this._descendantsOnlyPadding === value) {
644
+ return;
645
+ }
646
+ this._descendantsOnlyPadding = value;
647
+ this._markAsDirty();
648
+ }
649
+ /**
650
+ * Gets or sets a value indicating the padding to use on the left of the control
651
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
652
+ */
653
+ get paddingLeft() {
654
+ return this._paddingLeft.toString(this._host);
655
+ }
656
+ set paddingLeft(value) {
657
+ if (this._paddingLeft.fromString(value)) {
471
658
  this._markAsDirty();
472
- this._markMatrixAsDirty();
473
- },
474
- enumerable: false,
475
- configurable: true
476
- });
477
- Object.defineProperty(Control.prototype, "horizontalAlignment", {
478
- /**
479
- * Gets or sets the horizontal alignment
480
- * @see https://doc.babylonjs.com/how_to/gui#alignments
481
- */
482
- get: function () {
483
- return this._horizontalAlignment;
484
- },
485
- set: function (value) {
486
- if (this._horizontalAlignment === value) {
487
- return;
488
- }
489
- this._horizontalAlignment = value;
659
+ }
660
+ }
661
+ /**
662
+ * Gets or sets a value indicating the padding in pixels to use on the left of the control
663
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
664
+ */
665
+ get paddingLeftInPixels() {
666
+ return this._paddingLeft.getValueInPixel(this._host, this._cachedParentMeasure.width);
667
+ }
668
+ set paddingLeftInPixels(value) {
669
+ if (isNaN(value)) {
670
+ return;
671
+ }
672
+ this.paddingLeft = value + "px";
673
+ }
674
+ /** @hidden */
675
+ get _paddingLeftInPixels() {
676
+ if (this._descendantsOnlyPadding) {
677
+ return 0;
678
+ }
679
+ return this.paddingLeftInPixels;
680
+ }
681
+ /**
682
+ * Gets or sets a value indicating the padding to use on the right of the control
683
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
684
+ */
685
+ get paddingRight() {
686
+ return this._paddingRight.toString(this._host);
687
+ }
688
+ set paddingRight(value) {
689
+ if (this._paddingRight.fromString(value)) {
490
690
  this._markAsDirty();
491
- },
492
- enumerable: false,
493
- configurable: true
494
- });
495
- Object.defineProperty(Control.prototype, "verticalAlignment", {
496
- /**
497
- * Gets or sets the vertical alignment
498
- * @see https://doc.babylonjs.com/how_to/gui#alignments
499
- */
500
- get: function () {
501
- return this._verticalAlignment;
502
- },
503
- set: function (value) {
504
- if (this._verticalAlignment === value) {
505
- return;
506
- }
507
- this._verticalAlignment = value;
691
+ }
692
+ }
693
+ /**
694
+ * Gets or sets a value indicating the padding in pixels to use on the right of the control
695
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
696
+ */
697
+ get paddingRightInPixels() {
698
+ return this._paddingRight.getValueInPixel(this._host, this._cachedParentMeasure.width);
699
+ }
700
+ set paddingRightInPixels(value) {
701
+ if (isNaN(value)) {
702
+ return;
703
+ }
704
+ this.paddingRight = value + "px";
705
+ }
706
+ /** @hidden */
707
+ get _paddingRightInPixels() {
708
+ if (this._descendantsOnlyPadding) {
709
+ return 0;
710
+ }
711
+ return this.paddingRightInPixels;
712
+ }
713
+ /**
714
+ * Gets or sets a value indicating the padding to use on the top of the control
715
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
716
+ */
717
+ get paddingTop() {
718
+ return this._paddingTop.toString(this._host);
719
+ }
720
+ set paddingTop(value) {
721
+ if (this._paddingTop.fromString(value)) {
508
722
  this._markAsDirty();
509
- },
510
- enumerable: false,
511
- configurable: true
512
- });
513
- Object.defineProperty(Control.prototype, "width", {
514
- /**
515
- * Gets or sets control width
516
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
517
- */
518
- get: function () {
519
- return this._width.toString(this._host);
520
- },
521
- set: function (value) {
522
- this._fixedRatioMasterIsWidth = true;
523
- if (this._width.toString(this._host) === value) {
524
- return;
525
- }
526
- if (this._width.fromString(value)) {
527
- this._markAsDirty();
528
- }
529
- },
530
- enumerable: false,
531
- configurable: true
532
- });
533
- Object.defineProperty(Control.prototype, "widthInPixels", {
534
- /**
535
- * Gets or sets the control width in pixel
536
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
537
- */
538
- get: function () {
539
- return this._width.getValueInPixel(this._host, this._cachedParentMeasure.width);
540
- },
541
- set: function (value) {
542
- if (isNaN(value)) {
543
- return;
544
- }
545
- this._fixedRatioMasterIsWidth = true;
546
- this.width = value + "px";
547
- },
548
- enumerable: false,
549
- configurable: true
550
- });
551
- Object.defineProperty(Control.prototype, "height", {
552
- /**
553
- * Gets or sets control height
554
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
555
- */
556
- get: function () {
557
- return this._height.toString(this._host);
558
- },
559
- set: function (value) {
560
- this._fixedRatioMasterIsWidth = false;
561
- if (this._height.toString(this._host) === value) {
562
- return;
563
- }
564
- if (this._height.fromString(value)) {
565
- this._markAsDirty();
566
- }
567
- },
568
- enumerable: false,
569
- configurable: true
570
- });
571
- Object.defineProperty(Control.prototype, "heightInPixels", {
572
- /**
573
- * Gets or sets control height in pixel
574
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
575
- */
576
- get: function () {
577
- return this._height.getValueInPixel(this._host, this._cachedParentMeasure.height);
578
- },
579
- set: function (value) {
580
- if (isNaN(value)) {
581
- return;
582
- }
583
- this._fixedRatioMasterIsWidth = false;
584
- this.height = value + "px";
585
- },
586
- enumerable: false,
587
- configurable: true
588
- });
589
- Object.defineProperty(Control.prototype, "fontFamily", {
590
- /** Gets or set font family */
591
- get: function () {
592
- return this._fontFamily;
593
- },
594
- set: function (value) {
595
- if (this._fontFamily === value) {
596
- return;
597
- }
598
- this._fontFamily = value;
599
- this._resetFontCache();
600
- },
601
- enumerable: false,
602
- configurable: true
603
- });
604
- Object.defineProperty(Control.prototype, "fontStyle", {
605
- /** Gets or sets font style */
606
- get: function () {
607
- return this._fontStyle;
608
- },
609
- set: function (value) {
610
- if (this._fontStyle === value) {
611
- return;
612
- }
613
- this._fontStyle = value;
614
- this._resetFontCache();
615
- },
616
- enumerable: false,
617
- configurable: true
618
- });
619
- Object.defineProperty(Control.prototype, "fontWeight", {
620
- /** Gets or sets font weight */
621
- get: function () {
622
- return this._fontWeight;
623
- },
624
- set: function (value) {
625
- if (this._fontWeight === value) {
626
- return;
627
- }
628
- this._fontWeight = value;
629
- this._resetFontCache();
630
- },
631
- enumerable: false,
632
- configurable: true
633
- });
634
- Object.defineProperty(Control.prototype, "style", {
635
- /**
636
- * Gets or sets style
637
- * @see https://doc.babylonjs.com/how_to/gui#styles
638
- */
639
- get: function () {
640
- return this._style;
641
- },
642
- set: function (value) {
643
- var _this = this;
644
- if (this._style) {
645
- this._style.onChangedObservable.remove(this._styleObserver);
646
- this._styleObserver = null;
647
- }
648
- this._style = value;
649
- if (this._style) {
650
- this._styleObserver = this._style.onChangedObservable.add(function () {
651
- _this._markAsDirty();
652
- _this._resetFontCache();
653
- });
654
- }
723
+ }
724
+ }
725
+ /**
726
+ * Gets or sets a value indicating the padding in pixels to use on the top of the control
727
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
728
+ */
729
+ get paddingTopInPixels() {
730
+ return this._paddingTop.getValueInPixel(this._host, this._cachedParentMeasure.height);
731
+ }
732
+ set paddingTopInPixels(value) {
733
+ if (isNaN(value)) {
734
+ return;
735
+ }
736
+ this.paddingTop = value + "px";
737
+ }
738
+ /** @hidden */
739
+ get _paddingTopInPixels() {
740
+ if (this._descendantsOnlyPadding) {
741
+ return 0;
742
+ }
743
+ return this.paddingTopInPixels;
744
+ }
745
+ /**
746
+ * Gets or sets a value indicating the padding to use on the bottom of the control
747
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
748
+ */
749
+ get paddingBottom() {
750
+ return this._paddingBottom.toString(this._host);
751
+ }
752
+ set paddingBottom(value) {
753
+ if (this._paddingBottom.fromString(value)) {
655
754
  this._markAsDirty();
656
- this._resetFontCache();
657
- },
658
- enumerable: false,
659
- configurable: true
660
- });
661
- Object.defineProperty(Control.prototype, "_isFontSizeInPercentage", {
662
- /** @hidden */
663
- get: function () {
664
- return this._fontSize.isPercentage;
665
- },
666
- enumerable: false,
667
- configurable: true
668
- });
669
- Object.defineProperty(Control.prototype, "fontSizeInPixels", {
670
- /** Gets or sets font size in pixels */
671
- get: function () {
672
- var fontSizeToUse = this._style ? this._style._fontSize : this._fontSize;
673
- if (fontSizeToUse.isPixel) {
674
- return fontSizeToUse.getValue(this._host);
675
- }
676
- return fontSizeToUse.getValueInPixel(this._host, this._tempParentMeasure.height || this._cachedParentMeasure.height);
677
- },
678
- set: function (value) {
679
- if (isNaN(value)) {
680
- return;
681
- }
682
- this.fontSize = value + "px";
683
- },
684
- enumerable: false,
685
- configurable: true
686
- });
687
- Object.defineProperty(Control.prototype, "fontSize", {
688
- /** Gets or sets font size */
689
- get: function () {
690
- return this._fontSize.toString(this._host);
691
- },
692
- set: function (value) {
693
- if (this._fontSize.toString(this._host) === value) {
694
- return;
695
- }
696
- if (this._fontSize.fromString(value)) {
697
- this._markAsDirty();
698
- this._resetFontCache();
699
- }
700
- },
701
- enumerable: false,
702
- configurable: true
703
- });
704
- Object.defineProperty(Control.prototype, "color", {
705
- /** Gets or sets foreground color */
706
- get: function () {
707
- return this._color;
708
- },
709
- set: function (value) {
710
- if (this._color === value) {
711
- return;
712
- }
713
- this._color = value;
755
+ }
756
+ }
757
+ /**
758
+ * Gets or sets a value indicating the padding in pixels to use on the bottom of the control
759
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
760
+ */
761
+ get paddingBottomInPixels() {
762
+ return this._paddingBottom.getValueInPixel(this._host, this._cachedParentMeasure.height);
763
+ }
764
+ set paddingBottomInPixels(value) {
765
+ if (isNaN(value)) {
766
+ return;
767
+ }
768
+ this.paddingBottom = value + "px";
769
+ }
770
+ /** @hidden */
771
+ get _paddingBottomInPixels() {
772
+ if (this._descendantsOnlyPadding) {
773
+ return 0;
774
+ }
775
+ return this.paddingBottomInPixels;
776
+ }
777
+ /**
778
+ * Gets or sets a value indicating the left coordinate of the control
779
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
780
+ */
781
+ get left() {
782
+ return this._left.toString(this._host);
783
+ }
784
+ set left(value) {
785
+ if (this._left.fromString(value)) {
714
786
  this._markAsDirty();
715
- },
716
- enumerable: false,
717
- configurable: true
718
- });
719
- Object.defineProperty(Control.prototype, "zIndex", {
720
- /** Gets or sets z index which is used to reorder controls on the z axis */
721
- get: function () {
722
- return this._zIndex;
723
- },
724
- set: function (value) {
725
- if (this.zIndex === value) {
726
- return;
727
- }
728
- this._zIndex = value;
729
- if (this.parent) {
730
- this.parent._reOrderControl(this);
731
- }
732
- },
733
- enumerable: false,
734
- configurable: true
735
- });
736
- Object.defineProperty(Control.prototype, "notRenderable", {
737
- /** Gets or sets a boolean indicating if the control can be rendered */
738
- get: function () {
739
- return this._doNotRender;
740
- },
741
- set: function (value) {
742
- if (this._doNotRender === value) {
743
- return;
744
- }
745
- this._doNotRender = value;
787
+ }
788
+ }
789
+ /**
790
+ * Gets or sets a value indicating the left coordinate in pixels of the control
791
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
792
+ */
793
+ get leftInPixels() {
794
+ return this._left.getValueInPixel(this._host, this._cachedParentMeasure.width);
795
+ }
796
+ set leftInPixels(value) {
797
+ if (isNaN(value)) {
798
+ return;
799
+ }
800
+ this.left = value + "px";
801
+ }
802
+ /**
803
+ * Gets or sets a value indicating the top coordinate of the control
804
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
805
+ */
806
+ get top() {
807
+ return this._top.toString(this._host);
808
+ }
809
+ set top(value) {
810
+ if (this._top.fromString(value)) {
746
811
  this._markAsDirty();
747
- },
748
- enumerable: false,
749
- configurable: true
750
- });
751
- Object.defineProperty(Control.prototype, "isVisible", {
752
- /** Gets or sets a boolean indicating if the control is visible */
753
- get: function () {
754
- return this._isVisible;
755
- },
756
- set: function (value) {
757
- if (this._isVisible === value) {
758
- return;
759
- }
760
- this._isVisible = value;
761
- this._markAsDirty(true);
762
- },
763
- enumerable: false,
764
- configurable: true
765
- });
766
- Object.defineProperty(Control.prototype, "isDirty", {
767
- /** Gets a boolean indicating that the control needs to update its rendering */
768
- get: function () {
769
- return this._isDirty;
770
- },
771
- enumerable: false,
772
- configurable: true
773
- });
774
- Object.defineProperty(Control.prototype, "linkedMesh", {
775
- /**
776
- * Gets the current linked mesh (or null if none)
777
- */
778
- get: function () {
779
- return this._linkedMesh;
780
- },
781
- enumerable: false,
782
- configurable: true
783
- });
784
- Object.defineProperty(Control.prototype, "descendantsOnlyPadding", {
785
- /**
786
- * Gets or sets a value indicating the padding should work like in CSS.
787
- * Basically, it will add the padding amount on each side of the parent control for its children.
788
- */
789
- get: function () {
790
- return this._descendantsOnlyPadding;
791
- },
792
- set: function (value) {
793
- if (this._descendantsOnlyPadding === value) {
794
- return;
795
- }
796
- this._descendantsOnlyPadding = value;
812
+ }
813
+ }
814
+ /**
815
+ * Gets or sets a value indicating the top coordinate in pixels of the control
816
+ * @see https://doc.babylonjs.com/how_to/gui#position-and-size
817
+ */
818
+ get topInPixels() {
819
+ return this._top.getValueInPixel(this._host, this._cachedParentMeasure.height);
820
+ }
821
+ set topInPixels(value) {
822
+ if (isNaN(value)) {
823
+ return;
824
+ }
825
+ this.top = value + "px";
826
+ }
827
+ /**
828
+ * Gets or sets a value indicating the offset on X axis to the linked mesh
829
+ * @see https://doc.babylonjs.com/how_to/gui#tracking-positions
830
+ */
831
+ get linkOffsetX() {
832
+ return this._linkOffsetX.toString(this._host);
833
+ }
834
+ set linkOffsetX(value) {
835
+ if (this._linkOffsetX.fromString(value)) {
797
836
  this._markAsDirty();
798
- },
799
- enumerable: false,
800
- configurable: true
801
- });
802
- Object.defineProperty(Control.prototype, "paddingLeft", {
803
- /**
804
- * Gets or sets a value indicating the padding to use on the left of the control
805
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
806
- */
807
- get: function () {
808
- return this._paddingLeft.toString(this._host);
809
- },
810
- set: function (value) {
811
- if (this._paddingLeft.fromString(value)) {
812
- this._markAsDirty();
813
- }
814
- },
815
- enumerable: false,
816
- configurable: true
817
- });
818
- Object.defineProperty(Control.prototype, "paddingLeftInPixels", {
819
- /**
820
- * Gets or sets a value indicating the padding in pixels to use on the left of the control
821
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
822
- */
823
- get: function () {
824
- return this._paddingLeft.getValueInPixel(this._host, this._cachedParentMeasure.width);
825
- },
826
- set: function (value) {
827
- if (isNaN(value)) {
828
- return;
829
- }
830
- this.paddingLeft = value + "px";
831
- },
832
- enumerable: false,
833
- configurable: true
834
- });
835
- Object.defineProperty(Control.prototype, "_paddingLeftInPixels", {
836
- /** @hidden */
837
- get: function () {
838
- if (this._descendantsOnlyPadding) {
839
- return 0;
840
- }
841
- return this.paddingLeftInPixels;
842
- },
843
- enumerable: false,
844
- configurable: true
845
- });
846
- Object.defineProperty(Control.prototype, "paddingRight", {
847
- /**
848
- * Gets or sets a value indicating the padding to use on the right of the control
849
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
850
- */
851
- get: function () {
852
- return this._paddingRight.toString(this._host);
853
- },
854
- set: function (value) {
855
- if (this._paddingRight.fromString(value)) {
856
- this._markAsDirty();
857
- }
858
- },
859
- enumerable: false,
860
- configurable: true
861
- });
862
- Object.defineProperty(Control.prototype, "paddingRightInPixels", {
863
- /**
864
- * Gets or sets a value indicating the padding in pixels to use on the right of the control
865
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
866
- */
867
- get: function () {
868
- return this._paddingRight.getValueInPixel(this._host, this._cachedParentMeasure.width);
869
- },
870
- set: function (value) {
871
- if (isNaN(value)) {
872
- return;
873
- }
874
- this.paddingRight = value + "px";
875
- },
876
- enumerable: false,
877
- configurable: true
878
- });
879
- Object.defineProperty(Control.prototype, "_paddingRightInPixels", {
880
- /** @hidden */
881
- get: function () {
882
- if (this._descendantsOnlyPadding) {
883
- return 0;
884
- }
885
- return this.paddingRightInPixels;
886
- },
887
- enumerable: false,
888
- configurable: true
889
- });
890
- Object.defineProperty(Control.prototype, "paddingTop", {
891
- /**
892
- * Gets or sets a value indicating the padding to use on the top of the control
893
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
894
- */
895
- get: function () {
896
- return this._paddingTop.toString(this._host);
897
- },
898
- set: function (value) {
899
- if (this._paddingTop.fromString(value)) {
900
- this._markAsDirty();
901
- }
902
- },
903
- enumerable: false,
904
- configurable: true
905
- });
906
- Object.defineProperty(Control.prototype, "paddingTopInPixels", {
907
- /**
908
- * Gets or sets a value indicating the padding in pixels to use on the top of the control
909
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
910
- */
911
- get: function () {
912
- return this._paddingTop.getValueInPixel(this._host, this._cachedParentMeasure.height);
913
- },
914
- set: function (value) {
915
- if (isNaN(value)) {
916
- return;
917
- }
918
- this.paddingTop = value + "px";
919
- },
920
- enumerable: false,
921
- configurable: true
922
- });
923
- Object.defineProperty(Control.prototype, "_paddingTopInPixels", {
924
- /** @hidden */
925
- get: function () {
926
- if (this._descendantsOnlyPadding) {
927
- return 0;
928
- }
929
- return this.paddingTopInPixels;
930
- },
931
- enumerable: false,
932
- configurable: true
933
- });
934
- Object.defineProperty(Control.prototype, "paddingBottom", {
935
- /**
936
- * Gets or sets a value indicating the padding to use on the bottom of the control
937
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
938
- */
939
- get: function () {
940
- return this._paddingBottom.toString(this._host);
941
- },
942
- set: function (value) {
943
- if (this._paddingBottom.fromString(value)) {
944
- this._markAsDirty();
945
- }
946
- },
947
- enumerable: false,
948
- configurable: true
949
- });
950
- Object.defineProperty(Control.prototype, "paddingBottomInPixels", {
951
- /**
952
- * Gets or sets a value indicating the padding in pixels to use on the bottom of the control
953
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
954
- */
955
- get: function () {
956
- return this._paddingBottom.getValueInPixel(this._host, this._cachedParentMeasure.height);
957
- },
958
- set: function (value) {
959
- if (isNaN(value)) {
960
- return;
961
- }
962
- this.paddingBottom = value + "px";
963
- },
964
- enumerable: false,
965
- configurable: true
966
- });
967
- Object.defineProperty(Control.prototype, "_paddingBottomInPixels", {
968
- /** @hidden */
969
- get: function () {
970
- if (this._descendantsOnlyPadding) {
971
- return 0;
972
- }
973
- return this.paddingBottomInPixels;
974
- },
975
- enumerable: false,
976
- configurable: true
977
- });
978
- Object.defineProperty(Control.prototype, "left", {
979
- /**
980
- * Gets or sets a value indicating the left coordinate of the control
981
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
982
- */
983
- get: function () {
984
- return this._left.toString(this._host);
985
- },
986
- set: function (value) {
987
- if (this._left.fromString(value)) {
988
- this._markAsDirty();
989
- }
990
- },
991
- enumerable: false,
992
- configurable: true
993
- });
994
- Object.defineProperty(Control.prototype, "leftInPixels", {
995
- /**
996
- * Gets or sets a value indicating the left coordinate in pixels of the control
997
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
998
- */
999
- get: function () {
1000
- return this._left.getValueInPixel(this._host, this._cachedParentMeasure.width);
1001
- },
1002
- set: function (value) {
1003
- if (isNaN(value)) {
1004
- return;
1005
- }
1006
- this.left = value + "px";
1007
- },
1008
- enumerable: false,
1009
- configurable: true
1010
- });
1011
- Object.defineProperty(Control.prototype, "top", {
1012
- /**
1013
- * Gets or sets a value indicating the top coordinate of the control
1014
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
1015
- */
1016
- get: function () {
1017
- return this._top.toString(this._host);
1018
- },
1019
- set: function (value) {
1020
- if (this._top.fromString(value)) {
1021
- this._markAsDirty();
1022
- }
1023
- },
1024
- enumerable: false,
1025
- configurable: true
1026
- });
1027
- Object.defineProperty(Control.prototype, "topInPixels", {
1028
- /**
1029
- * Gets or sets a value indicating the top coordinate in pixels of the control
1030
- * @see https://doc.babylonjs.com/how_to/gui#position-and-size
1031
- */
1032
- get: function () {
1033
- return this._top.getValueInPixel(this._host, this._cachedParentMeasure.height);
1034
- },
1035
- set: function (value) {
1036
- if (isNaN(value)) {
1037
- return;
1038
- }
1039
- this.top = value + "px";
1040
- },
1041
- enumerable: false,
1042
- configurable: true
1043
- });
1044
- Object.defineProperty(Control.prototype, "linkOffsetX", {
1045
- /**
1046
- * Gets or sets a value indicating the offset on X axis to the linked mesh
1047
- * @see https://doc.babylonjs.com/how_to/gui#tracking-positions
1048
- */
1049
- get: function () {
1050
- return this._linkOffsetX.toString(this._host);
1051
- },
1052
- set: function (value) {
1053
- if (this._linkOffsetX.fromString(value)) {
1054
- this._markAsDirty();
1055
- }
1056
- },
1057
- enumerable: false,
1058
- configurable: true
1059
- });
1060
- Object.defineProperty(Control.prototype, "linkOffsetXInPixels", {
1061
- /**
1062
- * Gets or sets a value indicating the offset in pixels on X axis to the linked mesh
1063
- * @see https://doc.babylonjs.com/how_to/gui#tracking-positions
1064
- */
1065
- get: function () {
1066
- return this._linkOffsetX.getValueInPixel(this._host, this._cachedParentMeasure.width);
1067
- },
1068
- set: function (value) {
1069
- if (isNaN(value)) {
1070
- return;
1071
- }
1072
- this.linkOffsetX = value + "px";
1073
- },
1074
- enumerable: false,
1075
- configurable: true
1076
- });
1077
- Object.defineProperty(Control.prototype, "linkOffsetY", {
1078
- /**
1079
- * Gets or sets a value indicating the offset on Y axis to the linked mesh
1080
- * @see https://doc.babylonjs.com/how_to/gui#tracking-positions
1081
- */
1082
- get: function () {
1083
- return this._linkOffsetY.toString(this._host);
1084
- },
1085
- set: function (value) {
1086
- if (this._linkOffsetY.fromString(value)) {
1087
- this._markAsDirty();
1088
- }
1089
- },
1090
- enumerable: false,
1091
- configurable: true
1092
- });
1093
- Object.defineProperty(Control.prototype, "linkOffsetYInPixels", {
1094
- /**
1095
- * Gets or sets a value indicating the offset in pixels on Y axis to the linked mesh
1096
- * @see https://doc.babylonjs.com/how_to/gui#tracking-positions
1097
- */
1098
- get: function () {
1099
- return this._linkOffsetY.getValueInPixel(this._host, this._cachedParentMeasure.height);
1100
- },
1101
- set: function (value) {
1102
- if (isNaN(value)) {
1103
- return;
1104
- }
1105
- this.linkOffsetY = value + "px";
1106
- },
1107
- enumerable: false,
1108
- configurable: true
1109
- });
1110
- Object.defineProperty(Control.prototype, "centerX", {
1111
- /** Gets the center coordinate on X axis */
1112
- get: function () {
1113
- return this._currentMeasure.left + this._currentMeasure.width / 2;
1114
- },
1115
- enumerable: false,
1116
- configurable: true
1117
- });
1118
- Object.defineProperty(Control.prototype, "centerY", {
1119
- /** Gets the center coordinate on Y axis */
1120
- get: function () {
1121
- return this._currentMeasure.top + this._currentMeasure.height / 2;
1122
- },
1123
- enumerable: false,
1124
- configurable: true
1125
- });
1126
- Object.defineProperty(Control.prototype, "isEnabled", {
1127
- /** Gets or sets if control is Enabled */
1128
- get: function () {
1129
- return this._isEnabled;
1130
- },
1131
- set: function (value) {
1132
- var _this = this;
1133
- if (this._isEnabled === value) {
837
+ }
838
+ }
839
+ /**
840
+ * Gets or sets a value indicating the offset in pixels on X axis to the linked mesh
841
+ * @see https://doc.babylonjs.com/how_to/gui#tracking-positions
842
+ */
843
+ get linkOffsetXInPixels() {
844
+ return this._linkOffsetX.getValueInPixel(this._host, this._cachedParentMeasure.width);
845
+ }
846
+ set linkOffsetXInPixels(value) {
847
+ if (isNaN(value)) {
848
+ return;
849
+ }
850
+ this.linkOffsetX = value + "px";
851
+ }
852
+ /**
853
+ * Gets or sets a value indicating the offset on Y axis to the linked mesh
854
+ * @see https://doc.babylonjs.com/how_to/gui#tracking-positions
855
+ */
856
+ get linkOffsetY() {
857
+ return this._linkOffsetY.toString(this._host);
858
+ }
859
+ set linkOffsetY(value) {
860
+ if (this._linkOffsetY.fromString(value)) {
861
+ this._markAsDirty();
862
+ }
863
+ }
864
+ /**
865
+ * Gets or sets a value indicating the offset in pixels on Y axis to the linked mesh
866
+ * @see https://doc.babylonjs.com/how_to/gui#tracking-positions
867
+ */
868
+ get linkOffsetYInPixels() {
869
+ return this._linkOffsetY.getValueInPixel(this._host, this._cachedParentMeasure.height);
870
+ }
871
+ set linkOffsetYInPixels(value) {
872
+ if (isNaN(value)) {
873
+ return;
874
+ }
875
+ this.linkOffsetY = value + "px";
876
+ }
877
+ /** Gets the center coordinate on X axis */
878
+ get centerX() {
879
+ return this._currentMeasure.left + this._currentMeasure.width / 2;
880
+ }
881
+ /** Gets the center coordinate on Y axis */
882
+ get centerY() {
883
+ return this._currentMeasure.top + this._currentMeasure.height / 2;
884
+ }
885
+ /** Gets or sets if control is Enabled */
886
+ get isEnabled() {
887
+ return this._isEnabled;
888
+ }
889
+ set isEnabled(value) {
890
+ if (this._isEnabled === value) {
891
+ return;
892
+ }
893
+ this._isEnabled = value;
894
+ this._markAsDirty();
895
+ // if this control or any of it's descendants are under a pointer, we need to fire a pointerOut event
896
+ const recursivelyFirePointerOut = (control) => {
897
+ if (!control.host) {
1134
898
  return;
1135
899
  }
1136
- this._isEnabled = value;
1137
- this._markAsDirty();
1138
- // if this control or any of it's descendants are under a pointer, we need to fire a pointerOut event
1139
- var recursivelyFirePointerOut = function (control) {
1140
- if (!control.host) {
1141
- return;
1142
- }
1143
- for (var pointer in control.host._lastControlOver) {
1144
- if (control === _this.host._lastControlOver[pointer]) {
1145
- control._onPointerOut(control, null, true);
1146
- delete control.host._lastControlOver[pointer];
1147
- }
1148
- }
1149
- if (control.children !== undefined) {
1150
- control.children.forEach(recursivelyFirePointerOut);
900
+ for (const pointer in control.host._lastControlOver) {
901
+ if (control === this.host._lastControlOver[pointer]) {
902
+ control._onPointerOut(control, null, true);
903
+ delete control.host._lastControlOver[pointer];
1151
904
  }
1152
- };
1153
- recursivelyFirePointerOut(this);
1154
- },
1155
- enumerable: false,
1156
- configurable: true
1157
- });
1158
- Object.defineProperty(Control.prototype, "disabledColor", {
1159
- /** Gets or sets background color of control if it's disabled. Only applies to Button class. */
1160
- get: function () {
1161
- return this._disabledColor;
1162
- },
1163
- set: function (value) {
1164
- if (this._disabledColor === value) {
1165
- return;
1166
905
  }
1167
- this._disabledColor = value;
1168
- this._markAsDirty();
1169
- },
1170
- enumerable: false,
1171
- configurable: true
1172
- });
1173
- Object.defineProperty(Control.prototype, "disabledColorItem", {
1174
- /** Gets or sets front color of control if it's disabled. Only applies to Checkbox class. */
1175
- get: function () {
1176
- return this._disabledColorItem;
1177
- },
1178
- set: function (value) {
1179
- if (this._disabledColorItem === value) {
1180
- return;
906
+ if (control.children !== undefined) {
907
+ control.children.forEach(recursivelyFirePointerOut);
1181
908
  }
1182
- this._disabledColorItem = value;
1183
- this._markAsDirty();
1184
- },
1185
- enumerable: false,
1186
- configurable: true
1187
- });
909
+ };
910
+ recursivelyFirePointerOut(this);
911
+ }
912
+ /** Gets or sets background color of control if it's disabled. Only applies to Button class. */
913
+ get disabledColor() {
914
+ return this._disabledColor;
915
+ }
916
+ set disabledColor(value) {
917
+ if (this._disabledColor === value) {
918
+ return;
919
+ }
920
+ this._disabledColor = value;
921
+ this._markAsDirty();
922
+ }
923
+ /** Gets or sets front color of control if it's disabled. Only applies to Checkbox class. */
924
+ get disabledColorItem() {
925
+ return this._disabledColorItem;
926
+ }
927
+ set disabledColorItem(value) {
928
+ if (this._disabledColorItem === value) {
929
+ return;
930
+ }
931
+ this._disabledColorItem = value;
932
+ this._markAsDirty();
933
+ }
1188
934
  /** @hidden */
1189
- Control.prototype._getTypeName = function () {
935
+ _getTypeName() {
1190
936
  return "Control";
1191
- };
937
+ }
1192
938
  /**
1193
939
  * Gets the first ascendant in the hierarchy of the given type
1194
940
  * @param className defines the required type
1195
941
  * @returns the ascendant or null if not found
1196
942
  */
1197
- Control.prototype.getAscendantOfClass = function (className) {
943
+ getAscendantOfClass(className) {
1198
944
  if (!this.parent) {
1199
945
  return null;
1200
946
  }
@@ -1202,32 +948,31 @@ var Control = /** @class */ (function () {
1202
948
  return this.parent;
1203
949
  }
1204
950
  return this.parent.getAscendantOfClass(className);
1205
- };
951
+ }
1206
952
  /**
1207
953
  * Mark control element as dirty
1208
954
  * @param force force non visible elements to be marked too
1209
955
  */
1210
- Control.prototype.markAsDirty = function (force) {
1211
- if (force === void 0) { force = false; }
956
+ markAsDirty(force = false) {
1212
957
  this._markAsDirty(force);
1213
- };
958
+ }
1214
959
  /**
1215
960
  * Mark the element and its children as dirty
1216
961
  */
1217
- Control.prototype.markAllAsDirty = function () {
962
+ markAllAsDirty() {
1218
963
  this._markAllAsDirty();
1219
- };
964
+ }
1220
965
  /** @hidden */
1221
- Control.prototype._resetFontCache = function () {
966
+ _resetFontCache() {
1222
967
  this._fontSet = true;
1223
968
  this._markAsDirty();
1224
- };
969
+ }
1225
970
  /**
1226
971
  * Determines if a container is an ascendant of the current control
1227
972
  * @param container defines the container to look for
1228
973
  * @returns true if the container is one of the ascendant of the control
1229
974
  */
1230
- Control.prototype.isAscendant = function (container) {
975
+ isAscendant(container) {
1231
976
  if (!this.parent) {
1232
977
  return false;
1233
978
  }
@@ -1235,94 +980,93 @@ var Control = /** @class */ (function () {
1235
980
  return true;
1236
981
  }
1237
982
  return this.parent.isAscendant(container);
1238
- };
983
+ }
1239
984
  /**
1240
985
  * Gets coordinates in local control space
1241
986
  * @param globalCoordinates defines the coordinates to transform
1242
987
  * @returns the new coordinates in local space
1243
988
  */
1244
- Control.prototype.getLocalCoordinates = function (globalCoordinates) {
1245
- var result = Vector2.Zero();
989
+ getLocalCoordinates(globalCoordinates) {
990
+ const result = Vector2.Zero();
1246
991
  this.getLocalCoordinatesToRef(globalCoordinates, result);
1247
992
  return result;
1248
- };
993
+ }
1249
994
  /**
1250
995
  * Gets coordinates in local control space
1251
996
  * @param globalCoordinates defines the coordinates to transform
1252
997
  * @param result defines the target vector2 where to store the result
1253
998
  * @returns the current control
1254
999
  */
1255
- Control.prototype.getLocalCoordinatesToRef = function (globalCoordinates, result) {
1000
+ getLocalCoordinatesToRef(globalCoordinates, result) {
1256
1001
  result.x = globalCoordinates.x - this._currentMeasure.left;
1257
1002
  result.y = globalCoordinates.y - this._currentMeasure.top;
1258
1003
  return this;
1259
- };
1004
+ }
1260
1005
  /**
1261
1006
  * Gets coordinates in parent local control space
1262
1007
  * @param globalCoordinates defines the coordinates to transform
1263
1008
  * @returns the new coordinates in parent local space
1264
1009
  */
1265
- Control.prototype.getParentLocalCoordinates = function (globalCoordinates) {
1266
- var result = Vector2.Zero();
1010
+ getParentLocalCoordinates(globalCoordinates) {
1011
+ const result = Vector2.Zero();
1267
1012
  result.x = globalCoordinates.x - this._cachedParentMeasure.left;
1268
1013
  result.y = globalCoordinates.y - this._cachedParentMeasure.top;
1269
1014
  return result;
1270
- };
1015
+ }
1271
1016
  /**
1272
1017
  * Move the current control to a vector3 position projected onto the screen.
1273
1018
  * @param position defines the target position
1274
1019
  * @param scene defines the hosting scene
1275
1020
  */
1276
- Control.prototype.moveToVector3 = function (position, scene) {
1021
+ moveToVector3(position, scene) {
1277
1022
  if (!this._host || this.parent !== this._host._rootContainer) {
1278
1023
  Tools.Error("Cannot move a control to a vector3 if the control is not at root level");
1279
1024
  return;
1280
1025
  }
1281
1026
  this.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
1282
1027
  this.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
1283
- var globalViewport = this._host._getGlobalViewport();
1284
- var projectedPosition = Vector3.Project(position, Matrix.Identity(), scene.getTransformMatrix(), globalViewport);
1028
+ const globalViewport = this._host._getGlobalViewport();
1029
+ const projectedPosition = Vector3.Project(position, Matrix.Identity(), scene.getTransformMatrix(), globalViewport);
1285
1030
  this._moveToProjectedPosition(projectedPosition);
1286
1031
  if (projectedPosition.z < 0 || projectedPosition.z > 1) {
1287
1032
  this.notRenderable = true;
1288
1033
  return;
1289
1034
  }
1290
1035
  this.notRenderable = false;
1291
- };
1036
+ }
1292
1037
  /**
1293
1038
  * Will store all controls that have this control as ascendant in a given array
1294
1039
  * @param results defines the array where to store the descendants
1295
1040
  * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
1296
1041
  * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
1297
1042
  */
1298
- Control.prototype.getDescendantsToRef = function (results, directDescendantsOnly, predicate) {
1299
- if (directDescendantsOnly === void 0) { directDescendantsOnly = false; }
1043
+ getDescendantsToRef(results, directDescendantsOnly = false, predicate) {
1300
1044
  // Do nothing by default
1301
- };
1045
+ }
1302
1046
  /**
1303
1047
  * Will return all controls that have this control as ascendant
1304
1048
  * @param directDescendantsOnly defines if true only direct descendants of 'this' will be considered, if false direct and also indirect (children of children, an so on in a recursive manner) descendants of 'this' will be considered
1305
1049
  * @param predicate defines an optional predicate that will be called on every evaluated child, the predicate must return true for a given child to be part of the result, otherwise it will be ignored
1306
1050
  * @return all child controls
1307
1051
  */
1308
- Control.prototype.getDescendants = function (directDescendantsOnly, predicate) {
1309
- var results = new Array();
1052
+ getDescendants(directDescendantsOnly, predicate) {
1053
+ const results = new Array();
1310
1054
  this.getDescendantsToRef(results, directDescendantsOnly, predicate);
1311
1055
  return results;
1312
- };
1056
+ }
1313
1057
  /**
1314
1058
  * Link current control with a target mesh
1315
1059
  * @param mesh defines the mesh to link with
1316
1060
  * @see https://doc.babylonjs.com/how_to/gui#tracking-positions
1317
1061
  */
1318
- Control.prototype.linkWithMesh = function (mesh) {
1062
+ linkWithMesh(mesh) {
1319
1063
  if (!this._host || (this.parent && this.parent !== this._host._rootContainer)) {
1320
1064
  if (mesh) {
1321
1065
  Tools.Error("Cannot link a control to a mesh if the control is not at root level");
1322
1066
  }
1323
1067
  return;
1324
1068
  }
1325
- var index = this._host._linkedControls.indexOf(this);
1069
+ const index = this._host._linkedControls.indexOf(this);
1326
1070
  if (index !== -1) {
1327
1071
  this._linkedMesh = mesh;
1328
1072
  if (!mesh) {
@@ -1337,7 +1081,7 @@ var Control = /** @class */ (function () {
1337
1081
  this.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
1338
1082
  this._linkedMesh = mesh;
1339
1083
  this._host._linkedControls.push(this);
1340
- };
1084
+ }
1341
1085
  /**
1342
1086
  * Shorthand function to set the top, right, bottom, and left padding values on the control.
1343
1087
  * @param { string | number} paddingTop - The value of the top padding.
@@ -1346,16 +1090,16 @@ var Control = /** @class */ (function () {
1346
1090
  * @param { string | number} paddingLeft - The value of the left padding. If omitted, right is used.
1347
1091
  * @see https://doc.babylonjs.com/how_to/gui#position-and-size
1348
1092
  */
1349
- Control.prototype.setPadding = function (paddingTop, paddingRight, paddingBottom, paddingLeft) {
1350
- var top = paddingTop;
1351
- var right = paddingRight !== null && paddingRight !== void 0 ? paddingRight : top;
1352
- var bottom = paddingBottom !== null && paddingBottom !== void 0 ? paddingBottom : top;
1353
- var left = paddingLeft !== null && paddingLeft !== void 0 ? paddingLeft : right;
1093
+ setPadding(paddingTop, paddingRight, paddingBottom, paddingLeft) {
1094
+ const top = paddingTop;
1095
+ const right = paddingRight ?? top;
1096
+ const bottom = paddingBottom ?? top;
1097
+ const left = paddingLeft ?? right;
1354
1098
  this.paddingTop = top;
1355
1099
  this.paddingRight = right;
1356
1100
  this.paddingBottom = bottom;
1357
1101
  this.paddingLeft = left;
1358
- };
1102
+ }
1359
1103
  /**
1360
1104
  * Shorthand funtion to set the top, right, bottom, and left padding values in pixels on the control.
1361
1105
  * @param { number} paddingTop - The value in pixels of the top padding.
@@ -1364,30 +1108,29 @@ var Control = /** @class */ (function () {
1364
1108
  * @param { number} paddingLeft - The value in pixels of the left padding. If omitted, right is used.
1365
1109
  * @see https://doc.babylonjs.com/how_to/gui#position-and-size
1366
1110
  */
1367
- Control.prototype.setPaddingInPixels = function (paddingTop, paddingRight, paddingBottom, paddingLeft) {
1368
- var top = paddingTop;
1369
- var right = paddingRight !== null && paddingRight !== void 0 ? paddingRight : top;
1370
- var bottom = paddingBottom !== null && paddingBottom !== void 0 ? paddingBottom : top;
1371
- var left = paddingLeft !== null && paddingLeft !== void 0 ? paddingLeft : right;
1111
+ setPaddingInPixels(paddingTop, paddingRight, paddingBottom, paddingLeft) {
1112
+ const top = paddingTop;
1113
+ const right = paddingRight ?? top;
1114
+ const bottom = paddingBottom ?? top;
1115
+ const left = paddingLeft ?? right;
1372
1116
  this.paddingTopInPixels = top;
1373
1117
  this.paddingRightInPixels = right;
1374
1118
  this.paddingBottomInPixels = bottom;
1375
1119
  this.paddingLeftInPixels = left;
1376
- };
1120
+ }
1377
1121
  /**
1378
1122
  * @param projectedPosition
1379
1123
  * @hidden
1380
1124
  */
1381
- Control.prototype._moveToProjectedPosition = function (projectedPosition) {
1382
- var _a;
1383
- var oldLeft = this._left.getValue(this._host);
1384
- var oldTop = this._top.getValue(this._host);
1385
- var parentMeasure = (_a = this.parent) === null || _a === void 0 ? void 0 : _a._currentMeasure;
1125
+ _moveToProjectedPosition(projectedPosition) {
1126
+ const oldLeft = this._left.getValue(this._host);
1127
+ const oldTop = this._top.getValue(this._host);
1128
+ const parentMeasure = this.parent?._currentMeasure;
1386
1129
  if (parentMeasure) {
1387
1130
  this._processMeasures(parentMeasure, this._host.getContext());
1388
1131
  }
1389
- var newLeft = projectedPosition.x + this._linkOffsetX.getValue(this._host) - this._currentMeasure.width / 2;
1390
- var newTop = projectedPosition.y + this._linkOffsetY.getValue(this._host) - this._currentMeasure.height / 2;
1132
+ let newLeft = projectedPosition.x + this._linkOffsetX.getValue(this._host) - this._currentMeasure.width / 2;
1133
+ let newTop = projectedPosition.y + this._linkOffsetY.getValue(this._host) - this._currentMeasure.height / 2;
1391
1134
  if (this._left.ignoreAdaptiveScaling && this._top.ignoreAdaptiveScaling) {
1392
1135
  if (Math.abs(newLeft - oldLeft) < 0.5) {
1393
1136
  newLeft = oldLeft;
@@ -1401,38 +1144,38 @@ var Control = /** @class */ (function () {
1401
1144
  this._left.ignoreAdaptiveScaling = true;
1402
1145
  this._top.ignoreAdaptiveScaling = true;
1403
1146
  this._markAsDirty();
1404
- };
1147
+ }
1405
1148
  /**
1406
1149
  * @param offset
1407
1150
  * @hidden
1408
1151
  */
1409
- Control.prototype._offsetLeft = function (offset) {
1152
+ _offsetLeft(offset) {
1410
1153
  this._isDirty = true;
1411
1154
  this._currentMeasure.left += offset;
1412
- };
1155
+ }
1413
1156
  /**
1414
1157
  * @param offset
1415
1158
  * @hidden
1416
1159
  */
1417
- Control.prototype._offsetTop = function (offset) {
1160
+ _offsetTop(offset) {
1418
1161
  this._isDirty = true;
1419
1162
  this._currentMeasure.top += offset;
1420
- };
1163
+ }
1421
1164
  /** @hidden */
1422
- Control.prototype._markMatrixAsDirty = function () {
1165
+ _markMatrixAsDirty() {
1423
1166
  this._isMatrixDirty = true;
1424
1167
  this._flagDescendantsAsMatrixDirty();
1425
- };
1168
+ }
1426
1169
  /** @hidden */
1427
- Control.prototype._flagDescendantsAsMatrixDirty = function () {
1170
+ _flagDescendantsAsMatrixDirty() {
1428
1171
  // No child
1429
- };
1172
+ }
1430
1173
  /**
1431
1174
  * @param rect
1432
1175
  * @param context
1433
1176
  * @hidden
1434
1177
  */
1435
- Control.prototype._intersectsRect = function (rect, context) {
1178
+ _intersectsRect(rect, context) {
1436
1179
  // make sure we are transformed correctly before checking intersections. no-op if nothing is dirty.
1437
1180
  this._transform(context);
1438
1181
  if (this._evaluatedMeasure.left >= rect.left + rect.width) {
@@ -1448,18 +1191,18 @@ var Control = /** @class */ (function () {
1448
1191
  return false;
1449
1192
  }
1450
1193
  return true;
1451
- };
1194
+ }
1452
1195
  /** @hidden */
1453
- Control.prototype._computeAdditionnalOffsetX = function () {
1196
+ _computeAdditionnalOffsetX() {
1454
1197
  return 0;
1455
- };
1198
+ }
1456
1199
  /** @hidden */
1457
- Control.prototype._computeAdditionnalOffsetY = function () {
1200
+ _computeAdditionnalOffsetY() {
1458
1201
  return 0;
1459
- };
1202
+ }
1460
1203
  /** @hidden */
1461
1204
  // eslint-disable-next-line @typescript-eslint/naming-convention
1462
- Control.prototype.invalidateRect = function () {
1205
+ invalidateRect() {
1463
1206
  this._transform();
1464
1207
  if (this.host && this.host.useInvalidateRectOptimization) {
1465
1208
  // Rotate by transform to get the measure transformed to global space
@@ -1468,24 +1211,23 @@ var Control = /** @class */ (function () {
1468
1211
  // the previous measure is used to properly clear a control that is scaled down
1469
1212
  Measure.CombineToRef(this._tmpMeasureA, this._prevCurrentMeasureTransformedIntoGlobalSpace, this._tmpMeasureA);
1470
1213
  // Expand rect based on shadows
1471
- var shadowOffsetX = this.shadowOffsetX;
1472
- var shadowOffsetY = this.shadowOffsetY;
1473
- var shadowBlur = Math.max(this._previousShadowBlur, this.shadowBlur);
1474
- var leftShadowOffset = Math.min(Math.min(shadowOffsetX, 0) - shadowBlur * 2, 0);
1475
- var rightShadowOffset = Math.max(Math.max(shadowOffsetX, 0) + shadowBlur * 2, 0);
1476
- var topShadowOffset = Math.min(Math.min(shadowOffsetY, 0) - shadowBlur * 2, 0);
1477
- var bottomShadowOffset = Math.max(Math.max(shadowOffsetY, 0) + shadowBlur * 2, 0);
1478
- var offsetX = this._computeAdditionnalOffsetX();
1479
- var offsetY = this._computeAdditionnalOffsetY();
1214
+ const shadowOffsetX = this.shadowOffsetX;
1215
+ const shadowOffsetY = this.shadowOffsetY;
1216
+ const shadowBlur = Math.max(this._previousShadowBlur, this.shadowBlur);
1217
+ const leftShadowOffset = Math.min(Math.min(shadowOffsetX, 0) - shadowBlur * 2, 0);
1218
+ const rightShadowOffset = Math.max(Math.max(shadowOffsetX, 0) + shadowBlur * 2, 0);
1219
+ const topShadowOffset = Math.min(Math.min(shadowOffsetY, 0) - shadowBlur * 2, 0);
1220
+ const bottomShadowOffset = Math.max(Math.max(shadowOffsetY, 0) + shadowBlur * 2, 0);
1221
+ const offsetX = this._computeAdditionnalOffsetX();
1222
+ const offsetY = this._computeAdditionnalOffsetY();
1480
1223
  this.host.invalidateRect(Math.floor(this._tmpMeasureA.left + leftShadowOffset - offsetX), Math.floor(this._tmpMeasureA.top + topShadowOffset - offsetY), Math.ceil(this._tmpMeasureA.left + this._tmpMeasureA.width + rightShadowOffset + offsetX), Math.ceil(this._tmpMeasureA.top + this._tmpMeasureA.height + bottomShadowOffset + offsetY));
1481
1224
  }
1482
- };
1225
+ }
1483
1226
  /**
1484
1227
  * @param force
1485
1228
  * @hidden
1486
1229
  */
1487
- Control.prototype._markAsDirty = function (force) {
1488
- if (force === void 0) { force = false; }
1230
+ _markAsDirty(force = false) {
1489
1231
  if (!this._isVisible && !force) {
1490
1232
  return;
1491
1233
  }
@@ -1495,35 +1237,35 @@ var Control = /** @class */ (function () {
1495
1237
  if (this._host) {
1496
1238
  this._host.markAsDirty();
1497
1239
  }
1498
- };
1240
+ }
1499
1241
  /** @hidden */
1500
- Control.prototype._markAllAsDirty = function () {
1242
+ _markAllAsDirty() {
1501
1243
  this._markAsDirty();
1502
1244
  if (this._font) {
1503
1245
  this._prepareFont();
1504
1246
  }
1505
- };
1247
+ }
1506
1248
  /**
1507
1249
  * @param host
1508
1250
  * @hidden
1509
1251
  */
1510
- Control.prototype._link = function (host) {
1252
+ _link(host) {
1511
1253
  this._host = host;
1512
1254
  if (this._host) {
1513
1255
  this.uniqueId = this._host.getScene().getUniqueId();
1514
1256
  }
1515
- };
1257
+ }
1516
1258
  /**
1517
1259
  * @param context
1518
1260
  * @hidden
1519
1261
  */
1520
- Control.prototype._transform = function (context) {
1262
+ _transform(context) {
1521
1263
  if (!this._isMatrixDirty && this._scaleX === 1 && this._scaleY === 1 && this._rotation === 0) {
1522
1264
  return;
1523
1265
  }
1524
1266
  // postTranslate
1525
- var offsetX = this._currentMeasure.width * this._transformCenterX + this._currentMeasure.left;
1526
- var offsetY = this._currentMeasure.height * this._transformCenterY + this._currentMeasure.top;
1267
+ const offsetX = this._currentMeasure.width * this._transformCenterX + this._currentMeasure.left;
1268
+ const offsetY = this._currentMeasure.height * this._transformCenterY + this._currentMeasure.top;
1527
1269
  if (context) {
1528
1270
  context.translate(offsetX, offsetY);
1529
1271
  // rotate
@@ -1543,12 +1285,12 @@ var Control = /** @class */ (function () {
1543
1285
  this._transformMatrix.invertToRef(this._invertTransformMatrix);
1544
1286
  this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure);
1545
1287
  }
1546
- };
1288
+ }
1547
1289
  /**
1548
1290
  * @param context
1549
1291
  * @hidden
1550
1292
  */
1551
- Control.prototype._renderHighlight = function (context) {
1293
+ _renderHighlight(context) {
1552
1294
  if (!this.isHighlighted) {
1553
1295
  return;
1554
1296
  }
@@ -1557,19 +1299,19 @@ var Control = /** @class */ (function () {
1557
1299
  context.lineWidth = this._highlightLineWidth;
1558
1300
  this._renderHighlightSpecific(context);
1559
1301
  context.restore();
1560
- };
1302
+ }
1561
1303
  /**
1562
1304
  * @param context
1563
1305
  * @hidden
1564
1306
  */
1565
- Control.prototype._renderHighlightSpecific = function (context) {
1307
+ _renderHighlightSpecific(context) {
1566
1308
  context.strokeRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);
1567
- };
1309
+ }
1568
1310
  /**
1569
1311
  * @param context
1570
1312
  * @hidden
1571
1313
  */
1572
- Control.prototype._applyStates = function (context) {
1314
+ _applyStates(context) {
1573
1315
  if (this._isFontSizeInPercentage) {
1574
1316
  this._fontSet = true;
1575
1317
  }
@@ -1592,13 +1334,13 @@ var Control = /** @class */ (function () {
1592
1334
  else if (this._alphaSet) {
1593
1335
  context.globalAlpha = this.parent && !this.parent.renderToIntermediateTexture ? this.parent.alpha * this._alpha : this._alpha;
1594
1336
  }
1595
- };
1337
+ }
1596
1338
  /**
1597
1339
  * @param parentMeasure
1598
1340
  * @param context
1599
1341
  * @hidden
1600
1342
  */
1601
- Control.prototype._layout = function (parentMeasure, context) {
1343
+ _layout(parentMeasure, context) {
1602
1344
  if (!this.isDirty && (!this.isVisible || this.notRenderable)) {
1603
1345
  return false;
1604
1346
  }
@@ -1607,14 +1349,14 @@ var Control = /** @class */ (function () {
1607
1349
  this._currentMeasure.addAndTransformToRef(this._transformMatrix, -this._paddingLeftInPixels | 0, -this._paddingTopInPixels | 0, this._paddingRightInPixels | 0, this._paddingBottomInPixels | 0, this._prevCurrentMeasureTransformedIntoGlobalSpace);
1608
1350
  context.save();
1609
1351
  this._applyStates(context);
1610
- var rebuildCount = 0;
1352
+ let rebuildCount = 0;
1611
1353
  do {
1612
1354
  this._rebuildLayout = false;
1613
1355
  this._processMeasures(parentMeasure, context);
1614
1356
  rebuildCount++;
1615
1357
  } while (this._rebuildLayout && rebuildCount < 3);
1616
1358
  if (rebuildCount >= 3) {
1617
- Logger.Error("Layout cycle detected in GUI (Control name=".concat(this.name, ", uniqueId=").concat(this.uniqueId, ")"));
1359
+ Logger.Error(`Layout cycle detected in GUI (Control name=${this.name}, uniqueId=${this.uniqueId})`);
1618
1360
  }
1619
1361
  context.restore();
1620
1362
  this.invalidateRect();
@@ -1623,13 +1365,13 @@ var Control = /** @class */ (function () {
1623
1365
  this._wasDirty = this._isDirty;
1624
1366
  this._isDirty = false;
1625
1367
  return true;
1626
- };
1368
+ }
1627
1369
  /**
1628
1370
  * @param parentMeasure
1629
1371
  * @param context
1630
1372
  * @hidden
1631
1373
  */
1632
- Control.prototype._processMeasures = function (parentMeasure, context) {
1374
+ _processMeasures(parentMeasure, context) {
1633
1375
  this._tempPaddingMeasure.copyFrom(parentMeasure);
1634
1376
  // Apply padding if in correct mode
1635
1377
  if (this.parent && this.parent.descendantsOnlyPadding) {
@@ -1655,8 +1397,8 @@ var Control = /** @class */ (function () {
1655
1397
  if (this.onDirtyObservable.hasObservers()) {
1656
1398
  this.onDirtyObservable.notifyObservers(this);
1657
1399
  }
1658
- };
1659
- Control.prototype._evaluateClippingState = function (parentMeasure) {
1400
+ }
1401
+ _evaluateClippingState(parentMeasure) {
1660
1402
  this._currentMeasure.transformToRef(this._transformMatrix, this._evaluatedMeasure);
1661
1403
  if (this.parent && this.parent.clipChildren) {
1662
1404
  parentMeasure.transformToRef(this.parent._transformMatrix, this._evaluatedParentMeasure);
@@ -1679,9 +1421,9 @@ var Control = /** @class */ (function () {
1679
1421
  }
1680
1422
  }
1681
1423
  this._isClipped = false;
1682
- };
1424
+ }
1683
1425
  /** @hidden */
1684
- Control.prototype._measure = function () {
1426
+ _measure() {
1685
1427
  // Width / Height
1686
1428
  if (this._width.isPixel) {
1687
1429
  this._currentMeasure.width = this._width.getValue(this._host);
@@ -1703,20 +1445,20 @@ var Control = /** @class */ (function () {
1703
1445
  this._currentMeasure.width = this._currentMeasure.height * this.fixedRatio;
1704
1446
  }
1705
1447
  }
1706
- };
1448
+ }
1707
1449
  /**
1708
1450
  * @param parentMeasure
1709
1451
  * @param context
1710
1452
  * @hidden
1711
1453
  */
1712
- Control.prototype._computeAlignment = function (parentMeasure, context) {
1713
- var width = this._currentMeasure.width;
1714
- var height = this._currentMeasure.height;
1715
- var parentWidth = parentMeasure.width;
1716
- var parentHeight = parentMeasure.height;
1454
+ _computeAlignment(parentMeasure, context) {
1455
+ const width = this._currentMeasure.width;
1456
+ const height = this._currentMeasure.height;
1457
+ const parentWidth = parentMeasure.width;
1458
+ const parentHeight = parentMeasure.height;
1717
1459
  // Left / top
1718
- var x = 0;
1719
- var y = 0;
1460
+ let x = 0;
1461
+ let y = 0;
1720
1462
  switch (this.horizontalAlignment) {
1721
1463
  case Control.HORIZONTAL_ALIGNMENT_LEFT:
1722
1464
  x = 0;
@@ -1783,38 +1525,38 @@ var Control = /** @class */ (function () {
1783
1525
  }
1784
1526
  this._currentMeasure.left += x;
1785
1527
  this._currentMeasure.top += y;
1786
- };
1528
+ }
1787
1529
  /**
1788
1530
  * @param parentMeasure
1789
1531
  * @param context
1790
1532
  * @hidden
1791
1533
  */
1792
- Control.prototype._preMeasure = function (parentMeasure, context) {
1534
+ _preMeasure(parentMeasure, context) {
1793
1535
  // Do nothing
1794
- };
1536
+ }
1795
1537
  /**
1796
1538
  * @param parentMeasure
1797
1539
  * @param context
1798
1540
  * @hidden
1799
1541
  */
1800
- Control.prototype._additionalProcessing = function (parentMeasure, context) {
1542
+ _additionalProcessing(parentMeasure, context) {
1801
1543
  // Do nothing
1802
- };
1544
+ }
1803
1545
  /**
1804
1546
  * @param context
1805
1547
  * @hidden
1806
1548
  */
1807
- Control.prototype._clipForChildren = function (context) {
1549
+ _clipForChildren(context) {
1808
1550
  // DO nothing
1809
- };
1810
- Control.prototype._clip = function (context, invalidatedRectangle) {
1551
+ }
1552
+ _clip(context, invalidatedRectangle) {
1811
1553
  context.beginPath();
1812
1554
  Control._ClipMeasure.copyFrom(this._currentMeasure);
1813
1555
  if (invalidatedRectangle) {
1814
1556
  // Rotate the invalidated rect into the control's space
1815
1557
  invalidatedRectangle.transformToRef(this._invertTransformMatrix, this._tmpMeasureA);
1816
1558
  // Get the intersection of the rect in context space and the current context
1817
- var intersection = new Measure(0, 0, 0, 0);
1559
+ const intersection = new Measure(0, 0, 0, 0);
1818
1560
  intersection.left = Math.max(this._tmpMeasureA.left, this._currentMeasure.left);
1819
1561
  intersection.top = Math.max(this._tmpMeasureA.top, this._currentMeasure.top);
1820
1562
  intersection.width = Math.min(this._tmpMeasureA.left + this._tmpMeasureA.width, this._currentMeasure.left + this._currentMeasure.width) - intersection.left;
@@ -1822,26 +1564,26 @@ var Control = /** @class */ (function () {
1822
1564
  Control._ClipMeasure.copyFrom(intersection);
1823
1565
  }
1824
1566
  if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {
1825
- var shadowOffsetX = this.shadowOffsetX;
1826
- var shadowOffsetY = this.shadowOffsetY;
1827
- var shadowBlur = this.shadowBlur;
1828
- var leftShadowOffset = Math.min(Math.min(shadowOffsetX, 0) - shadowBlur * 2, 0);
1829
- var rightShadowOffset = Math.max(Math.max(shadowOffsetX, 0) + shadowBlur * 2, 0);
1830
- var topShadowOffset = Math.min(Math.min(shadowOffsetY, 0) - shadowBlur * 2, 0);
1831
- var bottomShadowOffset = Math.max(Math.max(shadowOffsetY, 0) + shadowBlur * 2, 0);
1567
+ const shadowOffsetX = this.shadowOffsetX;
1568
+ const shadowOffsetY = this.shadowOffsetY;
1569
+ const shadowBlur = this.shadowBlur;
1570
+ const leftShadowOffset = Math.min(Math.min(shadowOffsetX, 0) - shadowBlur * 2, 0);
1571
+ const rightShadowOffset = Math.max(Math.max(shadowOffsetX, 0) + shadowBlur * 2, 0);
1572
+ const topShadowOffset = Math.min(Math.min(shadowOffsetY, 0) - shadowBlur * 2, 0);
1573
+ const bottomShadowOffset = Math.max(Math.max(shadowOffsetY, 0) + shadowBlur * 2, 0);
1832
1574
  context.rect(Control._ClipMeasure.left + leftShadowOffset, Control._ClipMeasure.top + topShadowOffset, Control._ClipMeasure.width + rightShadowOffset - leftShadowOffset, Control._ClipMeasure.height + bottomShadowOffset - topShadowOffset);
1833
1575
  }
1834
1576
  else {
1835
1577
  context.rect(Control._ClipMeasure.left, Control._ClipMeasure.top, Control._ClipMeasure.width, Control._ClipMeasure.height);
1836
1578
  }
1837
1579
  context.clip();
1838
- };
1580
+ }
1839
1581
  /**
1840
1582
  * @param context
1841
1583
  * @param invalidatedRectangle
1842
1584
  * @hidden
1843
1585
  */
1844
- Control.prototype._render = function (context, invalidatedRectangle) {
1586
+ _render(context, invalidatedRectangle) {
1845
1587
  if (!this.isVisible || this.notRenderable || this._isClipped) {
1846
1588
  this._isDirty = false;
1847
1589
  return false;
@@ -1873,22 +1615,22 @@ var Control = /** @class */ (function () {
1873
1615
  }
1874
1616
  context.restore();
1875
1617
  return true;
1876
- };
1618
+ }
1877
1619
  /**
1878
1620
  * @param context
1879
1621
  * @param invalidatedRectangle
1880
1622
  * @hidden
1881
1623
  */
1882
- Control.prototype._draw = function (context, invalidatedRectangle) {
1624
+ _draw(context, invalidatedRectangle) {
1883
1625
  // Do nothing
1884
- };
1626
+ }
1885
1627
  /**
1886
1628
  * Tests if a given coordinates belong to the current control
1887
1629
  * @param x defines x coordinate to test
1888
1630
  * @param y defines y coordinate to test
1889
1631
  * @returns true if the coordinates are inside the control
1890
1632
  */
1891
- Control.prototype.contains = function (x, y) {
1633
+ contains(x, y) {
1892
1634
  // Invert transform
1893
1635
  this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition);
1894
1636
  x = this._transformedPosition.x;
@@ -1910,7 +1652,7 @@ var Control = /** @class */ (function () {
1910
1652
  this._host._shouldBlockPointer = true;
1911
1653
  }
1912
1654
  return true;
1913
- };
1655
+ }
1914
1656
  /**
1915
1657
  * @param x
1916
1658
  * @param y
@@ -1922,7 +1664,7 @@ var Control = /** @class */ (function () {
1922
1664
  * @param deltaY
1923
1665
  * @hidden
1924
1666
  */
1925
- Control.prototype._processPicking = function (x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) {
1667
+ _processPicking(x, y, pi, type, pointerId, buttonIndex, deltaX, deltaY) {
1926
1668
  if (!this._isEnabled) {
1927
1669
  return false;
1928
1670
  }
@@ -1934,7 +1676,7 @@ var Control = /** @class */ (function () {
1934
1676
  }
1935
1677
  this._processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY);
1936
1678
  return true;
1937
- };
1679
+ }
1938
1680
  /**
1939
1681
  * @param target
1940
1682
  * @param coordinates
@@ -1942,18 +1684,18 @@ var Control = /** @class */ (function () {
1942
1684
  * @param pi
1943
1685
  * @hidden
1944
1686
  */
1945
- Control.prototype._onPointerMove = function (target, coordinates, pointerId, pi) {
1946
- var canNotify = this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this, pi);
1687
+ _onPointerMove(target, coordinates, pointerId, pi) {
1688
+ const canNotify = this.onPointerMoveObservable.notifyObservers(coordinates, -1, target, this, pi);
1947
1689
  if (canNotify && this.parent != null && !this.isPointerBlocker) {
1948
1690
  this.parent._onPointerMove(target, coordinates, pointerId, pi);
1949
1691
  }
1950
- };
1692
+ }
1951
1693
  /**
1952
1694
  * @param target
1953
1695
  * @param pi
1954
1696
  * @hidden
1955
1697
  */
1956
- Control.prototype._onPointerEnter = function (target, pi) {
1698
+ _onPointerEnter(target, pi) {
1957
1699
  if (!this._isEnabled) {
1958
1700
  return false;
1959
1701
  }
@@ -1965,32 +1707,31 @@ var Control = /** @class */ (function () {
1965
1707
  this._enterCount = 0;
1966
1708
  }
1967
1709
  this._enterCount++;
1968
- var canNotify = this.onPointerEnterObservable.notifyObservers(this, -1, target, this, pi);
1710
+ const canNotify = this.onPointerEnterObservable.notifyObservers(this, -1, target, this, pi);
1969
1711
  if (canNotify && this.parent != null && !this.isPointerBlocker) {
1970
1712
  this.parent._onPointerEnter(target, pi);
1971
1713
  }
1972
1714
  return true;
1973
- };
1715
+ }
1974
1716
  /**
1975
1717
  * @param target
1976
1718
  * @param pi
1977
1719
  * @param force
1978
1720
  * @hidden
1979
1721
  */
1980
- Control.prototype._onPointerOut = function (target, pi, force) {
1981
- if (force === void 0) { force = false; }
1722
+ _onPointerOut(target, pi, force = false) {
1982
1723
  if (!force && (!this._isEnabled || target === this)) {
1983
1724
  return;
1984
1725
  }
1985
1726
  this._enterCount = 0;
1986
- var canNotify = true;
1727
+ let canNotify = true;
1987
1728
  if (!target.isAscendant(this)) {
1988
1729
  canNotify = this.onPointerOutObservable.notifyObservers(this, -1, target, this, pi);
1989
1730
  }
1990
1731
  if (canNotify && this.parent != null && !this.isPointerBlocker) {
1991
1732
  this.parent._onPointerOut(target, pi, force);
1992
1733
  }
1993
- };
1734
+ }
1994
1735
  /**
1995
1736
  * @param target
1996
1737
  * @param coordinates
@@ -1999,7 +1740,7 @@ var Control = /** @class */ (function () {
1999
1740
  * @param pi
2000
1741
  * @hidden
2001
1742
  */
2002
- Control.prototype._onPointerDown = function (target, coordinates, pointerId, buttonIndex, pi) {
1743
+ _onPointerDown(target, coordinates, pointerId, buttonIndex, pi) {
2003
1744
  // Prevent pointerout to lose control context.
2004
1745
  // Event redundancy is checked inside the function.
2005
1746
  this._onPointerEnter(this, pi);
@@ -2008,12 +1749,15 @@ var Control = /** @class */ (function () {
2008
1749
  }
2009
1750
  this._downCount++;
2010
1751
  this._downPointerIds[pointerId] = true;
2011
- var canNotify = this.onPointerDownObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi);
1752
+ const canNotify = this.onPointerDownObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi);
2012
1753
  if (canNotify && this.parent != null && !this.isPointerBlocker) {
2013
1754
  this.parent._onPointerDown(target, coordinates, pointerId, buttonIndex, pi);
2014
1755
  }
1756
+ if (pi && this.uniqueId !== this._host.rootContainer.uniqueId) {
1757
+ this._host._capturedPointerIds.add(pi.event.pointerId);
1758
+ }
2015
1759
  return true;
2016
- };
1760
+ }
2017
1761
  /**
2018
1762
  * @param target
2019
1763
  * @param coordinates
@@ -2023,52 +1767,54 @@ var Control = /** @class */ (function () {
2023
1767
  * @param pi
2024
1768
  * @hidden
2025
1769
  */
2026
- Control.prototype._onPointerUp = function (target, coordinates, pointerId, buttonIndex, notifyClick, pi) {
1770
+ _onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick, pi) {
2027
1771
  if (!this._isEnabled) {
2028
1772
  return;
2029
1773
  }
2030
1774
  this._downCount = 0;
2031
1775
  delete this._downPointerIds[pointerId];
2032
- var canNotifyClick = notifyClick;
1776
+ let canNotifyClick = notifyClick;
2033
1777
  if (notifyClick && (this._enterCount > 0 || this._enterCount === -1)) {
2034
1778
  canNotifyClick = this.onPointerClickObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi);
2035
1779
  }
2036
- var canNotify = this.onPointerUpObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi);
1780
+ const canNotify = this.onPointerUpObservable.notifyObservers(new Vector2WithInfo(coordinates, buttonIndex), -1, target, this, pi);
2037
1781
  if (canNotify && this.parent != null && !this.isPointerBlocker) {
2038
1782
  this.parent._onPointerUp(target, coordinates, pointerId, buttonIndex, canNotifyClick, pi);
2039
1783
  }
2040
- };
1784
+ if (pi && this.uniqueId !== this._host.rootContainer.uniqueId) {
1785
+ this._host._capturedPointerIds.delete(pi.event.pointerId);
1786
+ }
1787
+ }
2041
1788
  /**
2042
1789
  * @param pointerId
2043
1790
  * @hidden
2044
1791
  */
2045
- Control.prototype._forcePointerUp = function (pointerId) {
2046
- if (pointerId === void 0) { pointerId = null; }
1792
+ _forcePointerUp(pointerId = null) {
2047
1793
  if (pointerId !== null) {
2048
1794
  this._onPointerUp(this, Vector2.Zero(), pointerId, 0, true);
2049
1795
  }
2050
1796
  else {
2051
- for (var key in this._downPointerIds) {
1797
+ for (const key in this._downPointerIds) {
2052
1798
  this._onPointerUp(this, Vector2.Zero(), +key, 0, true);
2053
1799
  }
2054
1800
  }
2055
- };
1801
+ }
2056
1802
  /**
2057
1803
  * @param deltaX
2058
1804
  * @param deltaY
2059
1805
  * @hidden
2060
1806
  */
2061
- Control.prototype._onWheelScroll = function (deltaX, deltaY) {
1807
+ _onWheelScroll(deltaX, deltaY) {
2062
1808
  if (!this._isEnabled) {
2063
1809
  return;
2064
1810
  }
2065
- var canNotify = this.onWheelObservable.notifyObservers(new Vector2(deltaX, deltaY));
1811
+ const canNotify = this.onWheelObservable.notifyObservers(new Vector2(deltaX, deltaY));
2066
1812
  if (canNotify && this.parent != null) {
2067
1813
  this.parent._onWheelScroll(deltaX, deltaY);
2068
1814
  }
2069
- };
1815
+ }
2070
1816
  /** @hidden */
2071
- Control.prototype._onCanvasBlur = function () { };
1817
+ _onCanvasBlur() { }
2072
1818
  /**
2073
1819
  * @param type
2074
1820
  * @param x
@@ -2080,14 +1826,14 @@ var Control = /** @class */ (function () {
2080
1826
  * @param deltaY
2081
1827
  * @hidden
2082
1828
  */
2083
- Control.prototype._processObservables = function (type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY) {
1829
+ _processObservables(type, x, y, pi, pointerId, buttonIndex, deltaX, deltaY) {
2084
1830
  if (!this._isEnabled) {
2085
1831
  return false;
2086
1832
  }
2087
1833
  this._dummyVector2.copyFromFloats(x, y);
2088
1834
  if (type === PointerEventTypes.POINTERMOVE) {
2089
1835
  this._onPointerMove(this, this._dummyVector2, pointerId, pi);
2090
- var previousControlOver = this._host._lastControlOver[pointerId];
1836
+ const previousControlOver = this._host._lastControlOver[pointerId];
2091
1837
  if (previousControlOver && previousControlOver !== this) {
2092
1838
  previousControlOver._onPointerOut(this, pi);
2093
1839
  }
@@ -2117,8 +1863,8 @@ var Control = /** @class */ (function () {
2117
1863
  }
2118
1864
  }
2119
1865
  return false;
2120
- };
2121
- Control.prototype._prepareFont = function () {
1866
+ }
1867
+ _prepareFont() {
2122
1868
  if (!this._font && !this._fontSet) {
2123
1869
  return;
2124
1870
  }
@@ -2130,13 +1876,13 @@ var Control = /** @class */ (function () {
2130
1876
  }
2131
1877
  this._fontOffset = Control._GetFontOffset(this._font);
2132
1878
  //children need to be refreshed
2133
- this.getDescendants().forEach(function (child) { return child._markAllAsDirty(); });
2134
- };
1879
+ this.getDescendants().forEach((child) => child._markAllAsDirty());
1880
+ }
2135
1881
  /**
2136
1882
  * Serializes the current control
2137
1883
  * @param serializationObject defined the JSON serialized object
2138
1884
  */
2139
- Control.prototype.serialize = function (serializationObject) {
1885
+ serialize(serializationObject) {
2140
1886
  SerializationHelper.Serialize(this, serializationObject);
2141
1887
  serializationObject.name = this.name;
2142
1888
  serializationObject.className = this.getClassName();
@@ -2146,13 +1892,13 @@ var Control = /** @class */ (function () {
2146
1892
  serializationObject.fontWeight = this.fontWeight;
2147
1893
  serializationObject.fontStyle = this.fontStyle;
2148
1894
  }
2149
- };
1895
+ }
2150
1896
  /**
2151
1897
  * @param serializedObject
2152
1898
  * @param host
2153
1899
  * @hidden
2154
1900
  */
2155
- Control.prototype._parseFromContent = function (serializedObject, host) {
1901
+ _parseFromContent(serializedObject, host) {
2156
1902
  if (serializedObject.fontFamily) {
2157
1903
  this.fontFamily = serializedObject.fontFamily;
2158
1904
  }
@@ -2165,9 +1911,9 @@ var Control = /** @class */ (function () {
2165
1911
  if (serializedObject.fontStyle) {
2166
1912
  this.fontStyle = serializedObject.fontStyle;
2167
1913
  }
2168
- };
1914
+ }
2169
1915
  /** Releases associated resources */
2170
- Control.prototype.dispose = function () {
1916
+ dispose() {
2171
1917
  this.onDirtyObservable.clear();
2172
1918
  this.onBeforeDrawObservable.clear();
2173
1919
  this.onAfterDrawObservable.clear();
@@ -2187,7 +1933,7 @@ var Control = /** @class */ (function () {
2187
1933
  this.parent = null;
2188
1934
  }
2189
1935
  if (this._host) {
2190
- var index = this._host._linkedControls.indexOf(this);
1936
+ const index = this._host._linkedControls.indexOf(this);
2191
1937
  if (index > -1) {
2192
1938
  this.linkWithMesh(null);
2193
1939
  }
@@ -2195,84 +1941,60 @@ var Control = /** @class */ (function () {
2195
1941
  // Callback
2196
1942
  this.onDisposeObservable.notifyObservers(this);
2197
1943
  this.onDisposeObservable.clear();
2198
- };
2199
- Object.defineProperty(Control, "HORIZONTAL_ALIGNMENT_LEFT", {
2200
- /** HORIZONTAL_ALIGNMENT_LEFT */
2201
- get: function () {
2202
- return Control._HORIZONTAL_ALIGNMENT_LEFT;
2203
- },
2204
- enumerable: false,
2205
- configurable: true
2206
- });
2207
- Object.defineProperty(Control, "HORIZONTAL_ALIGNMENT_RIGHT", {
2208
- /** HORIZONTAL_ALIGNMENT_RIGHT */
2209
- get: function () {
2210
- return Control._HORIZONTAL_ALIGNMENT_RIGHT;
2211
- },
2212
- enumerable: false,
2213
- configurable: true
2214
- });
2215
- Object.defineProperty(Control, "HORIZONTAL_ALIGNMENT_CENTER", {
2216
- /** HORIZONTAL_ALIGNMENT_CENTER */
2217
- get: function () {
2218
- return Control._HORIZONTAL_ALIGNMENT_CENTER;
2219
- },
2220
- enumerable: false,
2221
- configurable: true
2222
- });
2223
- Object.defineProperty(Control, "VERTICAL_ALIGNMENT_TOP", {
2224
- /** VERTICAL_ALIGNMENT_TOP */
2225
- get: function () {
2226
- return Control._VERTICAL_ALIGNMENT_TOP;
2227
- },
2228
- enumerable: false,
2229
- configurable: true
2230
- });
2231
- Object.defineProperty(Control, "VERTICAL_ALIGNMENT_BOTTOM", {
2232
- /** VERTICAL_ALIGNMENT_BOTTOM */
2233
- get: function () {
2234
- return Control._VERTICAL_ALIGNMENT_BOTTOM;
2235
- },
2236
- enumerable: false,
2237
- configurable: true
2238
- });
2239
- Object.defineProperty(Control, "VERTICAL_ALIGNMENT_CENTER", {
2240
- /** VERTICAL_ALIGNMENT_CENTER */
2241
- get: function () {
2242
- return Control._VERTICAL_ALIGNMENT_CENTER;
2243
- },
2244
- enumerable: false,
2245
- configurable: true
2246
- });
1944
+ }
1945
+ /** HORIZONTAL_ALIGNMENT_LEFT */
1946
+ static get HORIZONTAL_ALIGNMENT_LEFT() {
1947
+ return Control._HORIZONTAL_ALIGNMENT_LEFT;
1948
+ }
1949
+ /** HORIZONTAL_ALIGNMENT_RIGHT */
1950
+ static get HORIZONTAL_ALIGNMENT_RIGHT() {
1951
+ return Control._HORIZONTAL_ALIGNMENT_RIGHT;
1952
+ }
1953
+ /** HORIZONTAL_ALIGNMENT_CENTER */
1954
+ static get HORIZONTAL_ALIGNMENT_CENTER() {
1955
+ return Control._HORIZONTAL_ALIGNMENT_CENTER;
1956
+ }
1957
+ /** VERTICAL_ALIGNMENT_TOP */
1958
+ static get VERTICAL_ALIGNMENT_TOP() {
1959
+ return Control._VERTICAL_ALIGNMENT_TOP;
1960
+ }
1961
+ /** VERTICAL_ALIGNMENT_BOTTOM */
1962
+ static get VERTICAL_ALIGNMENT_BOTTOM() {
1963
+ return Control._VERTICAL_ALIGNMENT_BOTTOM;
1964
+ }
1965
+ /** VERTICAL_ALIGNMENT_CENTER */
1966
+ static get VERTICAL_ALIGNMENT_CENTER() {
1967
+ return Control._VERTICAL_ALIGNMENT_CENTER;
1968
+ }
2247
1969
  /**
2248
1970
  * @param font
2249
1971
  * @hidden
2250
1972
  */
2251
- Control._GetFontOffset = function (font) {
1973
+ static _GetFontOffset(font) {
2252
1974
  if (Control._FontHeightSizes[font]) {
2253
1975
  return Control._FontHeightSizes[font];
2254
1976
  }
2255
- var engine = EngineStore.LastCreatedEngine;
1977
+ const engine = EngineStore.LastCreatedEngine;
2256
1978
  if (!engine) {
2257
1979
  throw new Error("Invalid engine. Unable to create a canvas.");
2258
1980
  }
2259
- var result = engine.getFontOffset(font);
1981
+ const result = engine.getFontOffset(font);
2260
1982
  Control._FontHeightSizes[font] = result;
2261
1983
  return result;
2262
- };
1984
+ }
2263
1985
  /**
2264
1986
  * Creates a Control from parsed data
2265
1987
  * @param serializedObject defines parsed data
2266
1988
  * @param host defines the hosting AdvancedDynamicTexture
2267
1989
  * @returns a new Control
2268
1990
  */
2269
- Control.Parse = function (serializedObject, host) {
2270
- var controlType = Tools.Instantiate("BABYLON.GUI." + serializedObject.className);
2271
- var control = SerializationHelper.Parse(function () { return new controlType(); }, serializedObject, null);
1991
+ static Parse(serializedObject, host) {
1992
+ const controlType = Tools.Instantiate("BABYLON.GUI." + serializedObject.className);
1993
+ const control = SerializationHelper.Parse(() => new controlType(), serializedObject, null);
2272
1994
  control.name = serializedObject.name;
2273
1995
  control._parseFromContent(serializedObject, host);
2274
1996
  return control;
2275
- };
1997
+ }
2276
1998
  /**
2277
1999
  * @param x
2278
2000
  * @param y
@@ -2281,7 +2003,7 @@ var Control = /** @class */ (function () {
2281
2003
  * @param context
2282
2004
  * @hidden
2283
2005
  */
2284
- Control.drawEllipse = function (x, y, width, height, context) {
2006
+ static drawEllipse(x, y, width, height, context) {
2285
2007
  context.translate(x, y);
2286
2008
  context.scale(width, height);
2287
2009
  context.beginPath();
@@ -2289,152 +2011,150 @@ var Control = /** @class */ (function () {
2289
2011
  context.closePath();
2290
2012
  context.scale(1 / width, 1 / height);
2291
2013
  context.translate(-x, -y);
2292
- };
2293
- /**
2294
- * Gets or sets a boolean indicating if alpha must be an inherited value (false by default)
2295
- */
2296
- Control.AllowAlphaInheritance = false;
2297
- Control._ClipMeasure = new Measure(0, 0, 0, 0);
2298
- // Statics
2299
- Control._HORIZONTAL_ALIGNMENT_LEFT = 0;
2300
- Control._HORIZONTAL_ALIGNMENT_RIGHT = 1;
2301
- Control._HORIZONTAL_ALIGNMENT_CENTER = 2;
2302
- Control._VERTICAL_ALIGNMENT_TOP = 0;
2303
- Control._VERTICAL_ALIGNMENT_BOTTOM = 1;
2304
- Control._VERTICAL_ALIGNMENT_CENTER = 2;
2305
- Control._FontHeightSizes = {};
2306
- Control.AddHeader = function () { };
2307
- __decorate([
2308
- serialize()
2309
- ], Control.prototype, "metadata", void 0);
2310
- __decorate([
2311
- serialize()
2312
- ], Control.prototype, "isHitTestVisible", void 0);
2313
- __decorate([
2314
- serialize()
2315
- ], Control.prototype, "isPointerBlocker", void 0);
2316
- __decorate([
2317
- serialize()
2318
- ], Control.prototype, "isFocusInvisible", void 0);
2319
- __decorate([
2320
- serialize()
2321
- ], Control.prototype, "clipChildren", void 0);
2322
- __decorate([
2323
- serialize()
2324
- ], Control.prototype, "clipContent", void 0);
2325
- __decorate([
2326
- serialize()
2327
- ], Control.prototype, "useBitmapCache", void 0);
2328
- __decorate([
2329
- serialize()
2330
- ], Control.prototype, "shadowOffsetX", null);
2331
- __decorate([
2332
- serialize()
2333
- ], Control.prototype, "shadowOffsetY", null);
2334
- __decorate([
2335
- serialize()
2336
- ], Control.prototype, "shadowBlur", null);
2337
- __decorate([
2338
- serialize()
2339
- ], Control.prototype, "shadowColor", null);
2340
- __decorate([
2341
- serialize()
2342
- ], Control.prototype, "hoverCursor", void 0);
2343
- __decorate([
2344
- serialize()
2345
- ], Control.prototype, "fontOffset", null);
2346
- __decorate([
2347
- serialize()
2348
- ], Control.prototype, "alpha", null);
2349
- __decorate([
2350
- serialize()
2351
- ], Control.prototype, "scaleX", null);
2352
- __decorate([
2353
- serialize()
2354
- ], Control.prototype, "scaleY", null);
2355
- __decorate([
2356
- serialize()
2357
- ], Control.prototype, "rotation", null);
2358
- __decorate([
2359
- serialize()
2360
- ], Control.prototype, "transformCenterY", null);
2361
- __decorate([
2362
- serialize()
2363
- ], Control.prototype, "transformCenterX", null);
2364
- __decorate([
2365
- serialize()
2366
- ], Control.prototype, "horizontalAlignment", null);
2367
- __decorate([
2368
- serialize()
2369
- ], Control.prototype, "verticalAlignment", null);
2370
- __decorate([
2371
- serialize()
2372
- ], Control.prototype, "fixedRatio", void 0);
2373
- __decorate([
2374
- serialize()
2375
- ], Control.prototype, "width", null);
2376
- __decorate([
2377
- serialize()
2378
- ], Control.prototype, "height", null);
2379
- __decorate([
2380
- serialize()
2381
- ], Control.prototype, "style", null);
2382
- __decorate([
2383
- serialize()
2384
- ], Control.prototype, "color", null);
2385
- __decorate([
2386
- serialize()
2387
- ], Control.prototype, "zIndex", null);
2388
- __decorate([
2389
- serialize()
2390
- ], Control.prototype, "notRenderable", null);
2391
- __decorate([
2392
- serialize()
2393
- ], Control.prototype, "isVisible", null);
2394
- __decorate([
2395
- serialize()
2396
- ], Control.prototype, "descendantsOnlyPadding", null);
2397
- __decorate([
2398
- serialize()
2399
- ], Control.prototype, "paddingLeft", null);
2400
- __decorate([
2401
- serialize()
2402
- ], Control.prototype, "paddingRight", null);
2403
- __decorate([
2404
- serialize()
2405
- ], Control.prototype, "paddingTop", null);
2406
- __decorate([
2407
- serialize()
2408
- ], Control.prototype, "paddingBottom", null);
2409
- __decorate([
2410
- serialize()
2411
- ], Control.prototype, "left", null);
2412
- __decorate([
2413
- serialize()
2414
- ], Control.prototype, "top", null);
2415
- __decorate([
2416
- serialize()
2417
- ], Control.prototype, "linkOffsetX", null);
2418
- __decorate([
2419
- serialize()
2420
- ], Control.prototype, "linkOffsetY", null);
2421
- __decorate([
2422
- serialize()
2423
- ], Control.prototype, "isEnabled", null);
2424
- __decorate([
2425
- serialize()
2426
- ], Control.prototype, "disabledColor", null);
2427
- __decorate([
2428
- serialize()
2429
- ], Control.prototype, "disabledColorItem", null);
2430
- __decorate([
2431
- serialize()
2432
- ], Control.prototype, "overlapGroup", void 0);
2433
- __decorate([
2434
- serialize()
2435
- ], Control.prototype, "overlapDeltaMultiplier", void 0);
2436
- return Control;
2437
- }());
2438
- export { Control };
2014
+ }
2015
+ }
2016
+ /**
2017
+ * Gets or sets a boolean indicating if alpha must be an inherited value (false by default)
2018
+ */
2019
+ Control.AllowAlphaInheritance = false;
2020
+ Control._ClipMeasure = new Measure(0, 0, 0, 0);
2021
+ // Statics
2022
+ Control._HORIZONTAL_ALIGNMENT_LEFT = 0;
2023
+ Control._HORIZONTAL_ALIGNMENT_RIGHT = 1;
2024
+ Control._HORIZONTAL_ALIGNMENT_CENTER = 2;
2025
+ Control._VERTICAL_ALIGNMENT_TOP = 0;
2026
+ Control._VERTICAL_ALIGNMENT_BOTTOM = 1;
2027
+ Control._VERTICAL_ALIGNMENT_CENTER = 2;
2028
+ Control._FontHeightSizes = {};
2029
+ Control.AddHeader = () => { };
2030
+ __decorate([
2031
+ serialize()
2032
+ ], Control.prototype, "metadata", void 0);
2033
+ __decorate([
2034
+ serialize()
2035
+ ], Control.prototype, "isHitTestVisible", void 0);
2036
+ __decorate([
2037
+ serialize()
2038
+ ], Control.prototype, "isPointerBlocker", void 0);
2039
+ __decorate([
2040
+ serialize()
2041
+ ], Control.prototype, "isFocusInvisible", void 0);
2042
+ __decorate([
2043
+ serialize()
2044
+ ], Control.prototype, "clipChildren", void 0);
2045
+ __decorate([
2046
+ serialize()
2047
+ ], Control.prototype, "clipContent", void 0);
2048
+ __decorate([
2049
+ serialize()
2050
+ ], Control.prototype, "useBitmapCache", void 0);
2051
+ __decorate([
2052
+ serialize()
2053
+ ], Control.prototype, "shadowOffsetX", null);
2054
+ __decorate([
2055
+ serialize()
2056
+ ], Control.prototype, "shadowOffsetY", null);
2057
+ __decorate([
2058
+ serialize()
2059
+ ], Control.prototype, "shadowBlur", null);
2060
+ __decorate([
2061
+ serialize()
2062
+ ], Control.prototype, "shadowColor", null);
2063
+ __decorate([
2064
+ serialize()
2065
+ ], Control.prototype, "hoverCursor", void 0);
2066
+ __decorate([
2067
+ serialize()
2068
+ ], Control.prototype, "fontOffset", null);
2069
+ __decorate([
2070
+ serialize()
2071
+ ], Control.prototype, "alpha", null);
2072
+ __decorate([
2073
+ serialize()
2074
+ ], Control.prototype, "scaleX", null);
2075
+ __decorate([
2076
+ serialize()
2077
+ ], Control.prototype, "scaleY", null);
2078
+ __decorate([
2079
+ serialize()
2080
+ ], Control.prototype, "rotation", null);
2081
+ __decorate([
2082
+ serialize()
2083
+ ], Control.prototype, "transformCenterY", null);
2084
+ __decorate([
2085
+ serialize()
2086
+ ], Control.prototype, "transformCenterX", null);
2087
+ __decorate([
2088
+ serialize()
2089
+ ], Control.prototype, "horizontalAlignment", null);
2090
+ __decorate([
2091
+ serialize()
2092
+ ], Control.prototype, "verticalAlignment", null);
2093
+ __decorate([
2094
+ serialize()
2095
+ ], Control.prototype, "fixedRatio", void 0);
2096
+ __decorate([
2097
+ serialize()
2098
+ ], Control.prototype, "width", null);
2099
+ __decorate([
2100
+ serialize()
2101
+ ], Control.prototype, "height", null);
2102
+ __decorate([
2103
+ serialize()
2104
+ ], Control.prototype, "style", null);
2105
+ __decorate([
2106
+ serialize()
2107
+ ], Control.prototype, "color", null);
2108
+ __decorate([
2109
+ serialize()
2110
+ ], Control.prototype, "zIndex", null);
2111
+ __decorate([
2112
+ serialize()
2113
+ ], Control.prototype, "notRenderable", null);
2114
+ __decorate([
2115
+ serialize()
2116
+ ], Control.prototype, "isVisible", null);
2117
+ __decorate([
2118
+ serialize()
2119
+ ], Control.prototype, "descendantsOnlyPadding", null);
2120
+ __decorate([
2121
+ serialize()
2122
+ ], Control.prototype, "paddingLeft", null);
2123
+ __decorate([
2124
+ serialize()
2125
+ ], Control.prototype, "paddingRight", null);
2126
+ __decorate([
2127
+ serialize()
2128
+ ], Control.prototype, "paddingTop", null);
2129
+ __decorate([
2130
+ serialize()
2131
+ ], Control.prototype, "paddingBottom", null);
2132
+ __decorate([
2133
+ serialize()
2134
+ ], Control.prototype, "left", null);
2135
+ __decorate([
2136
+ serialize()
2137
+ ], Control.prototype, "top", null);
2138
+ __decorate([
2139
+ serialize()
2140
+ ], Control.prototype, "linkOffsetX", null);
2141
+ __decorate([
2142
+ serialize()
2143
+ ], Control.prototype, "linkOffsetY", null);
2144
+ __decorate([
2145
+ serialize()
2146
+ ], Control.prototype, "isEnabled", null);
2147
+ __decorate([
2148
+ serialize()
2149
+ ], Control.prototype, "disabledColor", null);
2150
+ __decorate([
2151
+ serialize()
2152
+ ], Control.prototype, "disabledColorItem", null);
2153
+ __decorate([
2154
+ serialize()
2155
+ ], Control.prototype, "overlapGroup", void 0);
2156
+ __decorate([
2157
+ serialize()
2158
+ ], Control.prototype, "overlapDeltaMultiplier", void 0);
2439
2159
  RegisterClass("BABYLON.GUI.Control", Control);
2440
2160
  //# sourceMappingURL=control.js.map