@babylonjs/gui 6.38.0 → 6.38.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. package/2D/advancedDynamicTexture.js +6 -8
  2. package/2D/advancedDynamicTexture.js.map +1 -1
  3. package/2D/controls/container.js +4 -7
  4. package/2D/controls/container.js.map +1 -1
  5. package/2D/controls/control.js +11 -14
  6. package/2D/controls/control.js.map +1 -1
  7. package/2D/controls/gradient/LinearGradient.js +4 -4
  8. package/2D/controls/gradient/LinearGradient.js.map +1 -1
  9. package/2D/controls/gradient/RadialGradient.js +6 -6
  10. package/2D/controls/gradient/RadialGradient.js.map +1 -1
  11. package/2D/controls/grid.js +2 -2
  12. package/2D/controls/grid.js.map +1 -1
  13. package/2D/controls/image.js +4 -8
  14. package/2D/controls/image.js.map +1 -1
  15. package/2D/controls/inputText.js +4 -5
  16. package/2D/controls/inputText.js.map +1 -1
  17. package/2D/controls/inputTextArea.js +7 -9
  18. package/2D/controls/inputTextArea.js.map +1 -1
  19. package/2D/controls/textBlock.js +1 -2
  20. package/2D/controls/textBlock.js.map +1 -1
  21. package/2D/controls/toggleButton.js +3 -4
  22. package/2D/controls/toggleButton.js.map +1 -1
  23. package/3D/controls/MRTK3/touchHolographicButton.js +7 -14
  24. package/3D/controls/MRTK3/touchHolographicButton.js.map +1 -1
  25. package/3D/controls/contentDisplay3D.js +1 -2
  26. package/3D/controls/contentDisplay3D.js.map +1 -1
  27. package/3D/controls/control3D.js +2 -3
  28. package/3D/controls/control3D.js.map +1 -1
  29. package/3D/controls/holographicBackplate.js +1 -2
  30. package/3D/controls/holographicBackplate.js.map +1 -1
  31. package/3D/controls/holographicSlate.js +1 -2
  32. package/3D/controls/holographicSlate.js.map +1 -1
  33. package/3D/controls/slider3D.js +10 -13
  34. package/3D/controls/slider3D.js.map +1 -1
  35. package/3D/controls/touchButton3D.js +2 -4
  36. package/3D/controls/touchButton3D.js.map +1 -1
  37. package/3D/controls/touchHolographicButton.js +1 -2
  38. package/3D/controls/touchHolographicButton.js.map +1 -1
  39. package/3D/gui3DManager.js +3 -5
  40. package/3D/gui3DManager.js.map +1 -1
  41. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +1 -2
  42. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
  43. package/package.json +2 -2
@@ -15,10 +15,10 @@ export class LinearGradient extends BaseGradient {
15
15
  */
16
16
  constructor(x0, y0, x1, y1) {
17
17
  super();
18
- this._x0 = x0 !== null && x0 !== void 0 ? x0 : 0;
19
- this._y0 = y0 !== null && y0 !== void 0 ? y0 : 0;
20
- this._x1 = x1 !== null && x1 !== void 0 ? x1 : 0;
21
- this._y1 = y1 !== null && y1 !== void 0 ? y1 : 0;
18
+ this._x0 = x0 ?? 0;
19
+ this._y0 = y0 ?? 0;
20
+ this._x1 = x1 ?? 0;
21
+ this._y1 = y1 ?? 0;
22
22
  }
23
23
  _createCanvasGradient(context) {
24
24
  return context.createLinearGradient(this._x0, this._y0, this._x1, this._y1);
@@ -1 +1 @@
1
- {"version":3,"file":"LinearGradient.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/2D/controls/gradient/LinearGradient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAEpD;;;;GAIG;AACH,MAAM,OAAO,cAAe,SAAQ,YAAY;IAM5C;;;;;;OAMG;IACH,YAAY,EAAW,EAAE,EAAW,EAAE,EAAW,EAAE,EAAW;QAC1D,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,GAAG,GAAG,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,CAAC,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,CAAC,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,CAAC,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,EAAE,aAAF,EAAE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EAAE,CAAC;IACtC,CAAC;CACJ;AACD,aAAa,CAAC,4BAA4B,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import type { ICanvasGradient, ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\nimport { BaseGradient } from \"./BaseGradient\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\n\r\n/**\r\n * Gradient along a line that connects two coordinates.\r\n * These coordinates are relative to the canvas' space, not to any control's space.\r\n * @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createLinearGradient\r\n */\r\nexport class LinearGradient extends BaseGradient {\r\n private _x0: number;\r\n private _y0: number;\r\n private _x1: number;\r\n private _y1: number;\r\n\r\n /**\r\n * Creates a new linear gradient\r\n * @param x0\r\n * @param y0\r\n * @param x1\r\n * @param y1\r\n */\r\n constructor(x0?: number, y0?: number, x1?: number, y1?: number) {\r\n super();\r\n this._x0 = x0 ?? 0;\r\n this._y0 = y0 ?? 0;\r\n this._x1 = x1 ?? 0;\r\n this._y1 = y1 ?? 0;\r\n }\r\n\r\n protected _createCanvasGradient(context: ICanvasRenderingContext): ICanvasGradient {\r\n return context.createLinearGradient(this._x0, this._y0, this._x1, this._y1);\r\n }\r\n\r\n /** X axis coordinate of the starting point in the line */\r\n public get x0() {\r\n return this._x0;\r\n }\r\n\r\n /** X axis coordinate of the ending point in the line */\r\n public get x1() {\r\n return this._x1;\r\n }\r\n\r\n /** Y axis coordinate of the starting point in the line */\r\n public get y0() {\r\n return this._y0;\r\n }\r\n\r\n /** Y axis coordinate of the ending point in the line */\r\n public get y1() {\r\n return this._y1;\r\n }\r\n\r\n /**\r\n * Class name of the gradient\r\n * @returns the class name of the gradient\r\n */\r\n public getClassName(): string {\r\n return \"LinearGradient\";\r\n }\r\n\r\n /**\r\n * Serializes this gradient\r\n * @param serializationObject the object to serialize to\r\n */\r\n public serialize(serializationObject: any): void {\r\n super.serialize(serializationObject);\r\n serializationObject.x0 = this._x0;\r\n serializationObject.y0 = this._y0;\r\n serializationObject.x1 = this._x1;\r\n serializationObject.y1 = this._y1;\r\n }\r\n\r\n /**\r\n * Parses a gradient from a serialization object\r\n * @param serializationObject the object to parse from\r\n */\r\n public parse(serializationObject: any): void {\r\n super.parse(serializationObject);\r\n this._x0 = serializationObject.x0;\r\n this._y0 = serializationObject.y0;\r\n this._x1 = serializationObject.x1;\r\n this._y1 = serializationObject.y1;\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.LinearGradient\", LinearGradient);\r\n"]}
1
+ {"version":3,"file":"LinearGradient.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/2D/controls/gradient/LinearGradient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAEpD;;;;GAIG;AACH,MAAM,OAAO,cAAe,SAAQ,YAAY;IAM5C;;;;;;OAMG;IACH,YAAY,EAAW,EAAE,EAAW,EAAE,EAAW,EAAE,EAAW;QAC1D,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,GAAG,GAAG,EAAE,IAAI,CAAC,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,EAAE,IAAI,CAAC,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,EAAE,IAAI,CAAC,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,EAAE,IAAI,CAAC,CAAC;IACvB,CAAC;IAES,qBAAqB,CAAC,OAAgC;QAC5D,OAAO,OAAO,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IAChF,CAAC;IAED,0DAA0D;IAC1D,IAAW,EAAE;QACT,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,wDAAwD;IACxD,IAAW,EAAE;QACT,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,0DAA0D;IAC1D,IAAW,EAAE;QACT,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,wDAAwD;IACxD,IAAW,EAAE;QACT,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACI,SAAS,CAAC,mBAAwB;QACrC,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;QAClC,mBAAmB,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;QAClC,mBAAmB,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;QAClC,mBAAmB,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;IACtC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,mBAAwB;QACjC,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;QACjC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,EAAE,CAAC;IACtC,CAAC;CACJ;AACD,aAAa,CAAC,4BAA4B,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import type { ICanvasGradient, ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\nimport { BaseGradient } from \"./BaseGradient\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\n\r\n/**\r\n * Gradient along a line that connects two coordinates.\r\n * These coordinates are relative to the canvas' space, not to any control's space.\r\n * @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createLinearGradient\r\n */\r\nexport class LinearGradient extends BaseGradient {\r\n private _x0: number;\r\n private _y0: number;\r\n private _x1: number;\r\n private _y1: number;\r\n\r\n /**\r\n * Creates a new linear gradient\r\n * @param x0\r\n * @param y0\r\n * @param x1\r\n * @param y1\r\n */\r\n constructor(x0?: number, y0?: number, x1?: number, y1?: number) {\r\n super();\r\n this._x0 = x0 ?? 0;\r\n this._y0 = y0 ?? 0;\r\n this._x1 = x1 ?? 0;\r\n this._y1 = y1 ?? 0;\r\n }\r\n\r\n protected _createCanvasGradient(context: ICanvasRenderingContext): ICanvasGradient {\r\n return context.createLinearGradient(this._x0, this._y0, this._x1, this._y1);\r\n }\r\n\r\n /** X axis coordinate of the starting point in the line */\r\n public get x0() {\r\n return this._x0;\r\n }\r\n\r\n /** X axis coordinate of the ending point in the line */\r\n public get x1() {\r\n return this._x1;\r\n }\r\n\r\n /** Y axis coordinate of the starting point in the line */\r\n public get y0() {\r\n return this._y0;\r\n }\r\n\r\n /** Y axis coordinate of the ending point in the line */\r\n public get y1() {\r\n return this._y1;\r\n }\r\n\r\n /**\r\n * Class name of the gradient\r\n * @returns the class name of the gradient\r\n */\r\n public getClassName(): string {\r\n return \"LinearGradient\";\r\n }\r\n\r\n /**\r\n * Serializes this gradient\r\n * @param serializationObject the object to serialize to\r\n */\r\n public serialize(serializationObject: any): void {\r\n super.serialize(serializationObject);\r\n serializationObject.x0 = this._x0;\r\n serializationObject.y0 = this._y0;\r\n serializationObject.x1 = this._x1;\r\n serializationObject.y1 = this._y1;\r\n }\r\n\r\n /**\r\n * Parses a gradient from a serialization object\r\n * @param serializationObject the object to parse from\r\n */\r\n public parse(serializationObject: any): void {\r\n super.parse(serializationObject);\r\n this._x0 = serializationObject.x0;\r\n this._y0 = serializationObject.y0;\r\n this._x1 = serializationObject.x1;\r\n this._y1 = serializationObject.y1;\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.LinearGradient\", LinearGradient);\r\n"]}
@@ -17,12 +17,12 @@ export class RadialGradient extends BaseGradient {
17
17
  */
18
18
  constructor(x0, y0, r0, x1, y1, r1) {
19
19
  super();
20
- this._x0 = x0 !== null && x0 !== void 0 ? x0 : 0;
21
- this._y0 = y0 !== null && y0 !== void 0 ? y0 : 0;
22
- this._r0 = r0 !== null && r0 !== void 0 ? r0 : 0;
23
- this._x1 = x1 !== null && x1 !== void 0 ? x1 : 0;
24
- this._y1 = y1 !== null && y1 !== void 0 ? y1 : 0;
25
- this._r1 = r1 !== null && r1 !== void 0 ? r1 : 0;
20
+ this._x0 = x0 ?? 0;
21
+ this._y0 = y0 ?? 0;
22
+ this._r0 = r0 ?? 0;
23
+ this._x1 = x1 ?? 0;
24
+ this._y1 = y1 ?? 0;
25
+ this._r1 = r1 ?? 0;
26
26
  }
27
27
  _createCanvasGradient(context) {
28
28
  return context.createRadialGradient(this._x0, this._y0, this._r0, this._x1, this._y1, this._r1);
@@ -1 +1 @@
1
- {"version":3,"file":"RadialGradient.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/2D/controls/gradient/RadialGradient.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAEpD;;;;GAIG;AACH,MAAM,OAAO,cAAe,SAAQ,YAAY;IAQ5C;;;;;;;;OAQG;IACH,YAAY,EAAW,EAAE,EAAW,EAAE,EAAW,EAAE,EAAW,EAAE,EAAW,EAAE,EAAW;QACpF,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,GAAG,GAAG,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,CAAC,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,CAAC,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,CAAC,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,EAAE,aAAF,EAAE,cAAF,EAAE,GAAI,CAAC,CAAC;QACnB,IAAI,CAAC,GAAG,GAAG,EAAE,aAAF,EAAE,cAAF,E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,GAAG,CAAC;QAClC,mBAAmB,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;IACtC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,mBAAwB;QACjC,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;QACjC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,EAAE,CAAC;IACtC,CAAC;CACJ;AACD,aAAa,CAAC,4BAA4B,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import type { ICanvasGradient, ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\nimport { BaseGradient } from \"./BaseGradient\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\n\r\n/**\r\n * Gradient formed from two circles with their own centers and radius.\r\n * The coordinates of the circles centers are relative to the canvas' space, not to any control's space.\r\n * @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createRadialGradient\r\n */\r\nexport class RadialGradient extends BaseGradient {\r\n private _x0: number;\r\n private _y0: number;\r\n private _r0: number;\r\n private _x1: number;\r\n private _y1: number;\r\n private _r1: number;\r\n\r\n /**\r\n * Creates a new radial gradient\r\n * @param x0 x coordinate of the first circle's center\r\n * @param y0 y coordinate of the first circle's center\r\n * @param r0 radius of the first circle\r\n * @param x1 x coordinate of the second circle's center\r\n * @param y1 y coordinate of the second circle's center\r\n * @param r1 radius of the second circle\r\n */\r\n constructor(x0?: number, y0?: number, r0?: number, x1?: number, y1?: number, r1?: number) {\r\n super();\r\n this._x0 = x0 ?? 0;\r\n this._y0 = y0 ?? 0;\r\n this._r0 = r0 ?? 0;\r\n this._x1 = x1 ?? 0;\r\n this._y1 = y1 ?? 0;\r\n this._r1 = r1 ?? 0;\r\n }\r\n\r\n protected _createCanvasGradient(context: ICanvasRenderingContext): ICanvasGradient {\r\n return context.createRadialGradient(this._x0, this._y0, this._r0, this._x1, this._y1, this._r1);\r\n }\r\n\r\n /** x coordinate of the first circle's center */\r\n public get x0() {\r\n return this._x0;\r\n }\r\n\r\n /** x coordinate of the second circle's center */\r\n public get x1() {\r\n return this._x1;\r\n }\r\n\r\n /** y coordinate of the first circle's center */\r\n public get y0() {\r\n return this._y0;\r\n }\r\n\r\n /** y coordinate of the second circle's center */\r\n public get y1() {\r\n return this._y1;\r\n }\r\n\r\n /** radius of the first circle */\r\n public get r0() {\r\n return this._r0;\r\n }\r\n\r\n /** radius of the second circle */\r\n public get r1() {\r\n return this._r1;\r\n }\r\n\r\n /**\r\n * Class name of the gradient\r\n * @returns the class name of the gradient\r\n */\r\n public getClassName() {\r\n return \"RadialGradient\";\r\n }\r\n\r\n /**\r\n * Serializes this gradient\r\n * @param serializationObject the object to serialize to\r\n */\r\n public serialize(serializationObject: any): void {\r\n super.serialize(serializationObject);\r\n serializationObject.x0 = this._x0;\r\n serializationObject.y0 = this._y0;\r\n serializationObject.r0 = this._r0;\r\n serializationObject.x1 = this._x1;\r\n serializationObject.y1 = this._y1;\r\n serializationObject.r1 = this._r1;\r\n }\r\n\r\n /**\r\n * Parses a gradient from a serialization object\r\n * @param serializationObject the object to parse from\r\n */\r\n public parse(serializationObject: any): void {\r\n super.parse(serializationObject);\r\n this._x0 = serializationObject.x0;\r\n this._y0 = serializationObject.y0;\r\n this._r0 = serializationObject.r0;\r\n this._x1 = serializationObject.x1;\r\n this._y1 = serializationObject.y1;\r\n this._r1 = serializationObject.r1;\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.RadialGradient\", RadialGradient);\r\n"]}
1
+ {"version":3,"file":"RadialGradient.js","sourceRoot":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AAE;QACT,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,kCAAkC;IAClC,IAAW,EAAE;QACT,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED;;;OAGG;IACI,YAAY;QACf,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACI,SAAS,CAAC,mBAAwB;QACrC,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,mBAAmB,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;QAClC,mBAAmB,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;QAClC,mBAAmB,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;QAClC,mBAAmB,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;QAClC,mBAAmB,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;QAClC,mBAAmB,CAAC,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC;IACtC,CAAC;IAED;;;OAGG;IACI,KAAK,CAAC,mBAAwB;QACjC,KAAK,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAAC;QACjC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,EAAE,CAAC;QAClC,IAAI,CAAC,GAAG,GAAG,mBAAmB,CAAC,EAAE,CAAC;IACtC,CAAC;CACJ;AACD,aAAa,CAAC,4BAA4B,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import type { ICanvasGradient, ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\nimport { BaseGradient } from \"./BaseGradient\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\n\r\n/**\r\n * Gradient formed from two circles with their own centers and radius.\r\n * The coordinates of the circles centers are relative to the canvas' space, not to any control's space.\r\n * @see https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/createRadialGradient\r\n */\r\nexport class RadialGradient extends BaseGradient {\r\n private _x0: number;\r\n private _y0: number;\r\n private _r0: number;\r\n private _x1: number;\r\n private _y1: number;\r\n private _r1: number;\r\n\r\n /**\r\n * Creates a new radial gradient\r\n * @param x0 x coordinate of the first circle's center\r\n * @param y0 y coordinate of the first circle's center\r\n * @param r0 radius of the first circle\r\n * @param x1 x coordinate of the second circle's center\r\n * @param y1 y coordinate of the second circle's center\r\n * @param r1 radius of the second circle\r\n */\r\n constructor(x0?: number, y0?: number, r0?: number, x1?: number, y1?: number, r1?: number) {\r\n super();\r\n this._x0 = x0 ?? 0;\r\n this._y0 = y0 ?? 0;\r\n this._r0 = r0 ?? 0;\r\n this._x1 = x1 ?? 0;\r\n this._y1 = y1 ?? 0;\r\n this._r1 = r1 ?? 0;\r\n }\r\n\r\n protected _createCanvasGradient(context: ICanvasRenderingContext): ICanvasGradient {\r\n return context.createRadialGradient(this._x0, this._y0, this._r0, this._x1, this._y1, this._r1);\r\n }\r\n\r\n /** x coordinate of the first circle's center */\r\n public get x0() {\r\n return this._x0;\r\n }\r\n\r\n /** x coordinate of the second circle's center */\r\n public get x1() {\r\n return this._x1;\r\n }\r\n\r\n /** y coordinate of the first circle's center */\r\n public get y0() {\r\n return this._y0;\r\n }\r\n\r\n /** y coordinate of the second circle's center */\r\n public get y1() {\r\n return this._y1;\r\n }\r\n\r\n /** radius of the first circle */\r\n public get r0() {\r\n return this._r0;\r\n }\r\n\r\n /** radius of the second circle */\r\n public get r1() {\r\n return this._r1;\r\n }\r\n\r\n /**\r\n * Class name of the gradient\r\n * @returns the class name of the gradient\r\n */\r\n public getClassName() {\r\n return \"RadialGradient\";\r\n }\r\n\r\n /**\r\n * Serializes this gradient\r\n * @param serializationObject the object to serialize to\r\n */\r\n public serialize(serializationObject: any): void {\r\n super.serialize(serializationObject);\r\n serializationObject.x0 = this._x0;\r\n serializationObject.y0 = this._y0;\r\n serializationObject.r0 = this._r0;\r\n serializationObject.x1 = this._x1;\r\n serializationObject.y1 = this._y1;\r\n serializationObject.r1 = this._r1;\r\n }\r\n\r\n /**\r\n * Parses a gradient from a serialization object\r\n * @param serializationObject the object to parse from\r\n */\r\n public parse(serializationObject: any): void {\r\n super.parse(serializationObject);\r\n this._x0 = serializationObject.x0;\r\n this._y0 = serializationObject.y0;\r\n this._r0 = serializationObject.r0;\r\n this._x1 = serializationObject.x1;\r\n this._y1 = serializationObject.y1;\r\n this._r1 = serializationObject.r1;\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.RadialGradient\", RadialGradient);\r\n"]}
@@ -469,12 +469,12 @@ export class Grid extends Container {
469
469
  serializationObject.tags = [];
470
470
  for (let i = 0; i < this.columnCount; ++i) {
471
471
  const cd = this.getColumnDefinition(i);
472
- const childSerializationObject = { value: cd === null || cd === void 0 ? void 0 : cd.getValue(this.host), unit: cd === null || cd === void 0 ? void 0 : cd.unit };
472
+ const childSerializationObject = { value: cd?.getValue(this.host), unit: cd?.unit };
473
473
  serializationObject.columns.push(childSerializationObject);
474
474
  }
475
475
  for (let i = 0; i < this.rowCount; ++i) {
476
476
  const rd = this.getRowDefinition(i);
477
- const childSerializationObject = { value: rd === null || rd === void 0 ? void 0 : rd.getValue(this.host), unit: rd === null || rd === void 0 ? void 0 : rd.unit };
477
+ const childSerializationObject = { value: rd?.getValue(this.host), unit: rd?.unit };
478
478
  serializationObject.rows.push(childSerializationObject);
479
479
  }
480
480
  this.children.forEach((child) => {
@@ -1 +1 @@
1
- {"version":3,"file":"grid.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/controls/grid.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAA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,CAAC,CAAC,CAAC;YACtE,IAAI,KAAK,CAAC,SAAS,CAAC,EAAE;gBAClB,SAAS,GAAG,CAAC,CAAC;aACjB;YACD,IAAI,YAAY,GAAG,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC1E,IAAI,KAAK,CAAC,YAAY,CAAC,EAAE;gBACrB,YAAY,GAAG,CAAC,CAAC;aACpB;YACD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;SACzD;IACL,CAAC;CACJ;AA/jBG;IADC,SAAS,EAAE;uCAGX;AA8jBL,aAAa,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\n\r\nimport { Container } from \"./container\";\r\nimport { ValueAndUnit } from \"../valueAndUnit\";\r\nimport { Control } from \"./control\";\r\nimport type { Measure } from \"../measure\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\nimport type { AdvancedDynamicTexture } from \"../advancedDynamicTexture\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\n\r\n/**\r\n * Class used to create a 2D grid container\r\n */\r\nexport class Grid extends Container {\r\n private _rowDefinitions = new Array<ValueAndUnit>();\r\n private _rowDefinitionObservers: Observer<void>[] = [];\r\n private _columnDefinitions = new Array<ValueAndUnit>();\r\n private _columnDefinitionObservers: Observer<void>[] = [];\r\n private _cells: { [key: string]: Container } = {};\r\n private _childControls = new Array<Control>();\r\n\r\n /**\r\n * Sets/Gets a boolean indicating that control content must be clipped\r\n * Please note that not clipping content may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children\r\n */\r\n public set clipContent(value: boolean) {\r\n this._clipContent = value;\r\n\r\n // This value has to be replicated on all of the container cells\r\n for (const key in this._cells) {\r\n this._cells[key].clipContent = value;\r\n }\r\n }\r\n\r\n @serialize()\r\n public get clipContent(): boolean {\r\n return this._clipContent;\r\n }\r\n\r\n /**\r\n * Sets/Gets a boolean indicating if the children are clipped to the current control bounds.\r\n * Please note that not clipping children may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children\r\n */\r\n public set clipChildren(value: boolean) {\r\n this._clipChildren = value;\r\n\r\n // This value has to be replicated on all of the container cells\r\n for (const key in this._cells) {\r\n this._cells[key].clipChildren = value;\r\n }\r\n }\r\n\r\n public get clipChildren(): boolean {\r\n return this._clipChildren;\r\n }\r\n\r\n /**\r\n * Gets the number of columns\r\n */\r\n public get columnCount(): number {\r\n return this._columnDefinitions.length;\r\n }\r\n\r\n /**\r\n * Gets the number of rows\r\n */\r\n public get rowCount(): number {\r\n return this._rowDefinitions.length;\r\n }\r\n\r\n /** Gets the list of children */\r\n public get children(): Control[] {\r\n return this._childControls;\r\n }\r\n\r\n /** Gets the list of cells (e.g. the containers) */\r\n public get cells(): { [key: string]: Container } {\r\n return this._cells;\r\n }\r\n\r\n /**\r\n * Gets the definition of a specific row\r\n * @param index defines the index of the row\r\n * @returns the row definition\r\n */\r\n public getRowDefinition(index: number): Nullable<ValueAndUnit> {\r\n if (index < 0 || index >= this._rowDefinitions.length) {\r\n return null;\r\n }\r\n\r\n return this._rowDefinitions[index];\r\n }\r\n\r\n /**\r\n * Gets the definition of a specific column\r\n * @param index defines the index of the column\r\n * @returns the column definition\r\n */\r\n public getColumnDefinition(index: number): Nullable<ValueAndUnit> {\r\n if (index < 0 || index >= this._columnDefinitions.length) {\r\n return null;\r\n }\r\n\r\n return this._columnDefinitions[index];\r\n }\r\n\r\n /**\r\n * Adds a new row to the grid\r\n * @param height defines the height of the row (either in pixel or a value between 0 and 1)\r\n * @param isPixel defines if the height is expressed in pixel (or in percentage)\r\n * @returns the current grid\r\n */\r\n public addRowDefinition(height: number, isPixel = false): Grid {\r\n this._rowDefinitions.push(new ValueAndUnit(height, isPixel ? ValueAndUnit.UNITMODE_PIXEL : ValueAndUnit.UNITMODE_PERCENTAGE));\r\n this._rowDefinitionObservers.push(this._rowDefinitions[this.rowCount - 1].onChangedObservable.add(() => this._markAsDirty())!);\r\n this._markAsDirty();\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a new column to the grid\r\n * @param width defines the width of the column (either in pixel or a value between 0 and 1)\r\n * @param isPixel defines if the width is expressed in pixel (or in percentage)\r\n * @returns the current grid\r\n */\r\n public addColumnDefinition(width: number, isPixel = false): Grid {\r\n this._columnDefinitions.push(new ValueAndUnit(width, isPixel ? ValueAndUnit.UNITMODE_PIXEL : ValueAndUnit.UNITMODE_PERCENTAGE));\r\n this._columnDefinitionObservers.push(this._columnDefinitions[this.columnCount - 1].onChangedObservable.add(() => this._markAsDirty())!);\r\n this._markAsDirty();\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Update a row definition\r\n * @param index defines the index of the row to update\r\n * @param height defines the height of the row (either in pixel or a value between 0 and 1)\r\n * @param isPixel defines if the weight is expressed in pixel (or in percentage)\r\n * @returns the current grid\r\n */\r\n public setRowDefinition(index: number, height: number, isPixel = false): Grid {\r\n if (index < 0 || index >= this._rowDefinitions.length) {\r\n return this;\r\n }\r\n\r\n const current = this._rowDefinitions[index];\r\n if (current && current.isPixel === isPixel && current.value === height) {\r\n return this;\r\n }\r\n\r\n this._rowDefinitions[index].onChangedObservable.remove(this._rowDefinitionObservers[index]);\r\n this._rowDefinitions[index] = new ValueAndUnit(height, isPixel ? ValueAndUnit.UNITMODE_PIXEL : ValueAndUnit.UNITMODE_PERCENTAGE);\r\n this._rowDefinitionObservers[index] = this._rowDefinitions[index].onChangedObservable.add(() => this._markAsDirty())!;\r\n\r\n this._markAsDirty();\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Update a column definition\r\n * @param index defines the index of the column to update\r\n * @param width defines the width of the column (either in pixel or a value between 0 and 1)\r\n * @param isPixel defines if the width is expressed in pixel (or in percentage)\r\n * @returns the current grid\r\n */\r\n public setColumnDefinition(index: number, width: number, isPixel = false): Grid {\r\n if (index < 0 || index >= this._columnDefinitions.length) {\r\n return this;\r\n }\r\n\r\n const current = this._columnDefinitions[index];\r\n if (current && current.isPixel === isPixel && current.value === width) {\r\n return this;\r\n }\r\n\r\n this._columnDefinitions[index].onChangedObservable.remove(this._columnDefinitionObservers[index]);\r\n this._columnDefinitions[index] = new ValueAndUnit(width, isPixel ? ValueAndUnit.UNITMODE_PIXEL : ValueAndUnit.UNITMODE_PERCENTAGE);\r\n this._columnDefinitionObservers[index] = this._columnDefinitions[index].onChangedObservable.add(() => this._markAsDirty())!;\r\n\r\n this._markAsDirty();\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets the list of children stored in a specific cell\r\n * @param row defines the row to check\r\n * @param column defines the column to check\r\n * @returns the list of controls\r\n */\r\n public getChildrenAt(row: number, column: number): Nullable<Array<Control>> {\r\n const cell = this._cells[`${row}:${column}`];\r\n\r\n if (!cell) {\r\n return null;\r\n }\r\n\r\n return cell.children;\r\n }\r\n\r\n /**\r\n * Gets a string representing the child cell info (row x column)\r\n * @param child defines the control to get info from\r\n * @returns a string containing the child cell info (row x column)\r\n */\r\n public getChildCellInfo(child: Control): string {\r\n return child._tag;\r\n }\r\n\r\n private _removeCell(cell: Container, key: string) {\r\n if (!cell) {\r\n return;\r\n }\r\n\r\n super.removeControl(cell);\r\n\r\n for (const control of cell.children) {\r\n const childIndex = this._childControls.indexOf(control);\r\n\r\n if (childIndex !== -1) {\r\n this._childControls.splice(childIndex, 1);\r\n }\r\n }\r\n\r\n delete this._cells[key];\r\n }\r\n\r\n private _offsetCell(previousKey: string, key: string) {\r\n if (!this._cells[key]) {\r\n return;\r\n }\r\n\r\n this._cells[previousKey] = this._cells[key];\r\n\r\n for (const control of this._cells[previousKey].children) {\r\n control._tag = previousKey;\r\n }\r\n\r\n delete this._cells[key];\r\n }\r\n\r\n /**\r\n * Remove a column definition at specified index\r\n * @param index defines the index of the column to remove\r\n * @returns the current grid\r\n */\r\n public removeColumnDefinition(index: number): Grid {\r\n if (index < 0 || index >= this._columnDefinitions.length) {\r\n return this;\r\n }\r\n\r\n for (let x = 0; x < this._rowDefinitions.length; x++) {\r\n const key = `${x}:${index}`;\r\n const cell = this._cells[key];\r\n\r\n this._removeCell(cell, key);\r\n }\r\n\r\n for (let x = 0; x < this._rowDefinitions.length; x++) {\r\n for (let y = index + 1; y < this._columnDefinitions.length; y++) {\r\n const previousKey = `${x}:${y - 1}`;\r\n const key = `${x}:${y}`;\r\n\r\n this._offsetCell(previousKey, key);\r\n }\r\n }\r\n\r\n this._columnDefinitions[index].onChangedObservable.remove(this._columnDefinitionObservers[index]);\r\n this._columnDefinitions.splice(index, 1);\r\n this._columnDefinitionObservers.splice(index, 1);\r\n\r\n this._markAsDirty();\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Remove a row definition at specified index\r\n * @param index defines the index of the row to remove\r\n * @returns the current grid\r\n */\r\n public removeRowDefinition(index: number): Grid {\r\n if (index < 0 || index >= this._rowDefinitions.length) {\r\n return this;\r\n }\r\n\r\n for (let y = 0; y < this._columnDefinitions.length; y++) {\r\n const key = `${index}:${y}`;\r\n const cell = this._cells[key];\r\n\r\n this._removeCell(cell, key);\r\n }\r\n\r\n for (let y = 0; y < this._columnDefinitions.length; y++) {\r\n for (let x = index + 1; x < this._rowDefinitions.length; x++) {\r\n const previousKey = `${x - 1}:${y}`;\r\n const key = `${x}:${y}`;\r\n\r\n this._offsetCell(previousKey, key);\r\n }\r\n }\r\n\r\n this._rowDefinitions[index].onChangedObservable.remove(this._rowDefinitionObservers[index]);\r\n this._rowDefinitions.splice(index, 1);\r\n this._rowDefinitionObservers.splice(index, 1);\r\n\r\n this._markAsDirty();\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a new control to the current grid\r\n * @param control defines the control to add\r\n * @param row defines the row where to add the control (0 by default)\r\n * @param column defines the column where to add the control (0 by default)\r\n * @returns the current grid\r\n */\r\n public addControl(control: Control, row: number = 0, column: number = 0): Grid {\r\n if (this._rowDefinitions.length === 0) {\r\n // Add default row definition\r\n this.addRowDefinition(1, false);\r\n }\r\n\r\n if (this._columnDefinitions.length === 0) {\r\n // Add default column definition\r\n this.addColumnDefinition(1, false);\r\n }\r\n\r\n if (this._childControls.indexOf(control) !== -1) {\r\n Tools.Warn(`Control (Name:${control.name}, UniqueId:${control.uniqueId}) is already associated with this grid. You must remove it before reattaching it`);\r\n return this;\r\n }\r\n\r\n const x = Math.min(row, this._rowDefinitions.length - 1);\r\n const y = Math.min(column, this._columnDefinitions.length - 1);\r\n const key = `${x}:${y}`;\r\n let goodContainer = this._cells[key];\r\n\r\n if (!goodContainer) {\r\n goodContainer = new Container(key);\r\n this._cells[key] = goodContainer;\r\n goodContainer.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n goodContainer.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n goodContainer.clipContent = this.clipContent;\r\n goodContainer.clipChildren = this.clipChildren;\r\n super.addControl(goodContainer);\r\n }\r\n\r\n goodContainer.addControl(control);\r\n this._childControls.push(control);\r\n control._tag = key;\r\n control.parent = this;\r\n\r\n this._markAsDirty();\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Removes a control from the current container\r\n * @param control defines the control to remove\r\n * @returns the current container\r\n */\r\n public removeControl(control: Control): Container {\r\n const index = this._childControls.indexOf(control);\r\n\r\n if (index !== -1) {\r\n this._childControls.splice(index, 1);\r\n }\r\n\r\n const cell = this._cells[control._tag];\r\n\r\n if (cell) {\r\n cell.removeControl(control);\r\n control._tag = null;\r\n }\r\n\r\n this._markAsDirty();\r\n return this;\r\n }\r\n\r\n /**\r\n * Creates a new Grid\r\n * @param name defines control name\r\n */\r\n constructor(public name?: string) {\r\n super(name);\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"Grid\";\r\n }\r\n\r\n protected _getGridDefinitions(definitionCallback: (lefts: number[], tops: number[], widths: number[], heights: number[]) => void) {\r\n const widths = [];\r\n const heights = [];\r\n const lefts = [];\r\n const tops = [];\r\n\r\n let availableWidth = this._currentMeasure.width;\r\n let globalWidthPercentage = 0;\r\n let availableHeight = this._currentMeasure.height;\r\n let globalHeightPercentage = 0;\r\n\r\n // Heights\r\n let index = 0;\r\n for (const rowDefinition of this._rowDefinitions) {\r\n if (rowDefinition.isPixel) {\r\n const height = rowDefinition.getValue(this._host);\r\n availableHeight -= height;\r\n heights[index] = height;\r\n } else {\r\n globalHeightPercentage += rowDefinition.value;\r\n }\r\n index++;\r\n }\r\n\r\n let top = 0;\r\n index = 0;\r\n for (const rowDefinition of this._rowDefinitions) {\r\n tops.push(top);\r\n\r\n if (!rowDefinition.isPixel) {\r\n const height = Math.round((rowDefinition.value / globalHeightPercentage) * availableHeight);\r\n top += height;\r\n heights[index] = height;\r\n } else {\r\n top += rowDefinition.getValue(this._host);\r\n }\r\n index++;\r\n }\r\n\r\n // Widths\r\n index = 0;\r\n for (const columnDefinition of this._columnDefinitions) {\r\n if (columnDefinition.isPixel) {\r\n const width = columnDefinition.getValue(this._host);\r\n availableWidth -= width;\r\n widths[index] = width;\r\n } else {\r\n globalWidthPercentage += columnDefinition.value;\r\n }\r\n index++;\r\n }\r\n\r\n let left = 0;\r\n index = 0;\r\n for (const columnDefinition of this._columnDefinitions) {\r\n lefts.push(left);\r\n if (!columnDefinition.isPixel) {\r\n const width = Math.round((columnDefinition.value / globalWidthPercentage) * availableWidth);\r\n left += width;\r\n widths[index] = width;\r\n } else {\r\n left += columnDefinition.getValue(this._host);\r\n }\r\n index++;\r\n }\r\n\r\n definitionCallback(lefts, tops, widths, heights);\r\n }\r\n\r\n protected _additionalProcessing(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n this._getGridDefinitions((lefts: number[], tops: number[], widths: number[], heights: number[]) => {\r\n // Setting child sizes\r\n for (const key in this._cells) {\r\n if (!Object.prototype.hasOwnProperty.call(this._cells, key)) {\r\n continue;\r\n }\r\n const split = key.split(\":\");\r\n const x = parseInt(split[0]);\r\n const y = parseInt(split[1]);\r\n const cell = this._cells[key];\r\n\r\n cell.leftInPixels = lefts[y];\r\n cell.topInPixels = tops[x];\r\n cell.widthInPixels = widths[y];\r\n cell.heightInPixels = heights[x];\r\n cell._left.ignoreAdaptiveScaling = true;\r\n cell._top.ignoreAdaptiveScaling = true;\r\n cell._width.ignoreAdaptiveScaling = true;\r\n cell._height.ignoreAdaptiveScaling = true;\r\n }\r\n });\r\n\r\n super._additionalProcessing(parentMeasure, context);\r\n }\r\n\r\n public _flagDescendantsAsMatrixDirty(): void {\r\n for (const key in this._cells) {\r\n if (!Object.prototype.hasOwnProperty.call(this._cells, key)) {\r\n continue;\r\n }\r\n\r\n const child = this._cells[key];\r\n child._markMatrixAsDirty();\r\n }\r\n }\r\n\r\n public _renderHighlightSpecific(context: ICanvasRenderingContext): void {\r\n super._renderHighlightSpecific(context);\r\n\r\n this._getGridDefinitions((lefts: number[], tops: number[], widths: number[], heights: number[]) => {\r\n // Columns\r\n for (let index = 0; index < lefts.length; index++) {\r\n const left = this._currentMeasure.left + lefts[index] + widths[index];\r\n context.beginPath();\r\n context.moveTo(left, this._currentMeasure.top);\r\n context.lineTo(left, this._currentMeasure.top + this._currentMeasure.height);\r\n context.stroke();\r\n }\r\n\r\n // Rows\r\n for (let index = 0; index < tops.length; index++) {\r\n const top = this._currentMeasure.top + tops[index] + heights[index];\r\n context.beginPath();\r\n context.moveTo(this._currentMeasure.left, top);\r\n context.lineTo(this._currentMeasure.left + this._currentMeasure.width, top);\r\n context.stroke();\r\n }\r\n });\r\n\r\n context.restore();\r\n }\r\n\r\n /** Releases associated resources */\r\n public dispose() {\r\n super.dispose();\r\n\r\n for (const control of this._childControls) {\r\n control.dispose();\r\n }\r\n for (let index = 0; index < this._rowDefinitions.length; index++) {\r\n this._rowDefinitions[index].onChangedObservable.remove(this._rowDefinitionObservers[index]);\r\n }\r\n for (let index = 0; index < this._columnDefinitions.length; index++) {\r\n this._columnDefinitions[index].onChangedObservable.remove(this._columnDefinitionObservers[index]);\r\n }\r\n this._rowDefinitionObservers.length = 0;\r\n this._rowDefinitions.length = 0;\r\n this._columnDefinitionObservers.length = 0;\r\n this._columnDefinitions.length = 0;\r\n this._cells = {};\r\n this._childControls.length = 0;\r\n }\r\n\r\n /**\r\n * Serializes the current control\r\n * @param serializationObject defined the JSON serialized object\r\n */\r\n public serialize(serializationObject: any) {\r\n super.serialize(serializationObject);\r\n serializationObject.columnCount = this.columnCount;\r\n serializationObject.rowCount = this.rowCount;\r\n serializationObject.columns = [];\r\n serializationObject.rows = [];\r\n serializationObject.tags = [];\r\n for (let i = 0; i < this.columnCount; ++i) {\r\n const cd = this.getColumnDefinition(i);\r\n const childSerializationObject = { value: cd?.getValue(this.host), unit: cd?.unit };\r\n serializationObject.columns.push(childSerializationObject);\r\n }\r\n for (let i = 0; i < this.rowCount; ++i) {\r\n const rd = this.getRowDefinition(i);\r\n const childSerializationObject = { value: rd?.getValue(this.host), unit: rd?.unit };\r\n serializationObject.rows.push(childSerializationObject);\r\n }\r\n this.children.forEach((child) => {\r\n serializationObject.tags.push(child._tag);\r\n });\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _parseFromContent(serializedObject: any, host: AdvancedDynamicTexture) {\r\n super._parseFromContent(serializedObject, host);\r\n const children: Control[] = [];\r\n this.children.forEach((child) => {\r\n children.push(child);\r\n });\r\n this.removeRowDefinition(0);\r\n this.removeColumnDefinition(0);\r\n for (let i = 0; i < serializedObject.columnCount; ++i) {\r\n const columnValue = serializedObject.columns[i].value;\r\n const unit = serializedObject.columns[i].unit;\r\n this.addColumnDefinition(columnValue, unit === 1 ? true : false);\r\n }\r\n for (let i = 0; i < serializedObject.rowCount; ++i) {\r\n const rowValue = serializedObject.rows[i].value;\r\n const unit = serializedObject.rows[i].unit;\r\n this.addRowDefinition(rowValue, unit === 1 ? true : false);\r\n }\r\n\r\n for (let i = 0; i < children.length; ++i) {\r\n const cellInfo = serializedObject.tags[i];\r\n let rowNumber = parseInt(cellInfo.substring(0, cellInfo.search(\":\")));\r\n if (isNaN(rowNumber)) {\r\n rowNumber = 0;\r\n }\r\n let columnNumber = parseInt(cellInfo.substring(cellInfo.search(\":\") + 1));\r\n if (isNaN(columnNumber)) {\r\n columnNumber = 0;\r\n }\r\n this.addControl(children[i], rowNumber, columnNumber);\r\n }\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.Grid\", Grid);\r\n"]}
1
+ {"version":3,"file":"grid.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/controls/grid.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,KAAK,EAAE,sCAAwB;AACxC,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAIpD,OAAO,EAAE,SAAS,EAAE,2CAA6B;AAEjD;;GAEG;AACH,MAAM,OAAO,IAAK,SAAQ,SAAS;IAQ/B;;;OAGG;IACH,IAAW,WAAW,CAAC,KAAc;QACjC,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAE1B,gEAAgE;QAChE,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,MAAM,EAAE;YAC3B,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,WAAW,GAAG,KAAK,CAAC;SACxC;IACL,CAAC;IAGD,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED;;;OAGG;IACH,IAAW,YAAY,CAAC,KAAc;QAClC,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAE3B,gEAAgE;QAChE,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,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AAC,CAAC,IAAI,CAAC;YAC3C,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,IAAI,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;SAC9D;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,EAAE;YACtC,MAAM,QAAQ,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC1C,IAAI,SAAS,GAAG,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YACtE,IAAI,KAAK,CAAC,SAAS,CAAC,EAAE;gBAClB,SAAS,GAAG,CAAC,CAAC;aACjB;YACD,IAAI,YAAY,GAAG,QAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;YAC1E,IAAI,KAAK,CAAC,YAAY,CAAC,EAAE;gBACrB,YAAY,GAAG,CAAC,CAAC;aACpB;YACD,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;SACzD;IACL,CAAC;CACJ;AA/jBG;IADC,SAAS,EAAE;uCAGX;AA8jBL,aAAa,CAAC,kBAAkB,EAAE,IAAI,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\n\r\nimport { Container } from \"./container\";\r\nimport { ValueAndUnit } from \"../valueAndUnit\";\r\nimport { Control } from \"./control\";\r\nimport type { Measure } from \"../measure\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\nimport type { AdvancedDynamicTexture } from \"../advancedDynamicTexture\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\n\r\n/**\r\n * Class used to create a 2D grid container\r\n */\r\nexport class Grid extends Container {\r\n private _rowDefinitions = new Array<ValueAndUnit>();\r\n private _rowDefinitionObservers: Observer<void>[] = [];\r\n private _columnDefinitions = new Array<ValueAndUnit>();\r\n private _columnDefinitionObservers: Observer<void>[] = [];\r\n private _cells: { [key: string]: Container } = {};\r\n private _childControls = new Array<Control>();\r\n\r\n /**\r\n * Sets/Gets a boolean indicating that control content must be clipped\r\n * Please note that not clipping content may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children\r\n */\r\n public set clipContent(value: boolean) {\r\n this._clipContent = value;\r\n\r\n // This value has to be replicated on all of the container cells\r\n for (const key in this._cells) {\r\n this._cells[key].clipContent = value;\r\n }\r\n }\r\n\r\n @serialize()\r\n public get clipContent(): boolean {\r\n return this._clipContent;\r\n }\r\n\r\n /**\r\n * Sets/Gets a boolean indicating if the children are clipped to the current control bounds.\r\n * Please note that not clipping children may generate issues with adt.useInvalidateRectOptimization so it is recommended to turn this optimization off if you want to use unclipped children\r\n */\r\n public set clipChildren(value: boolean) {\r\n this._clipChildren = value;\r\n\r\n // This value has to be replicated on all of the container cells\r\n for (const key in this._cells) {\r\n this._cells[key].clipChildren = value;\r\n }\r\n }\r\n\r\n public get clipChildren(): boolean {\r\n return this._clipChildren;\r\n }\r\n\r\n /**\r\n * Gets the number of columns\r\n */\r\n public get columnCount(): number {\r\n return this._columnDefinitions.length;\r\n }\r\n\r\n /**\r\n * Gets the number of rows\r\n */\r\n public get rowCount(): number {\r\n return this._rowDefinitions.length;\r\n }\r\n\r\n /** Gets the list of children */\r\n public get children(): Control[] {\r\n return this._childControls;\r\n }\r\n\r\n /** Gets the list of cells (e.g. the containers) */\r\n public get cells(): { [key: string]: Container } {\r\n return this._cells;\r\n }\r\n\r\n /**\r\n * Gets the definition of a specific row\r\n * @param index defines the index of the row\r\n * @returns the row definition\r\n */\r\n public getRowDefinition(index: number): Nullable<ValueAndUnit> {\r\n if (index < 0 || index >= this._rowDefinitions.length) {\r\n return null;\r\n }\r\n\r\n return this._rowDefinitions[index];\r\n }\r\n\r\n /**\r\n * Gets the definition of a specific column\r\n * @param index defines the index of the column\r\n * @returns the column definition\r\n */\r\n public getColumnDefinition(index: number): Nullable<ValueAndUnit> {\r\n if (index < 0 || index >= this._columnDefinitions.length) {\r\n return null;\r\n }\r\n\r\n return this._columnDefinitions[index];\r\n }\r\n\r\n /**\r\n * Adds a new row to the grid\r\n * @param height defines the height of the row (either in pixel or a value between 0 and 1)\r\n * @param isPixel defines if the height is expressed in pixel (or in percentage)\r\n * @returns the current grid\r\n */\r\n public addRowDefinition(height: number, isPixel = false): Grid {\r\n this._rowDefinitions.push(new ValueAndUnit(height, isPixel ? ValueAndUnit.UNITMODE_PIXEL : ValueAndUnit.UNITMODE_PERCENTAGE));\r\n this._rowDefinitionObservers.push(this._rowDefinitions[this.rowCount - 1].onChangedObservable.add(() => this._markAsDirty())!);\r\n this._markAsDirty();\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a new column to the grid\r\n * @param width defines the width of the column (either in pixel or a value between 0 and 1)\r\n * @param isPixel defines if the width is expressed in pixel (or in percentage)\r\n * @returns the current grid\r\n */\r\n public addColumnDefinition(width: number, isPixel = false): Grid {\r\n this._columnDefinitions.push(new ValueAndUnit(width, isPixel ? ValueAndUnit.UNITMODE_PIXEL : ValueAndUnit.UNITMODE_PERCENTAGE));\r\n this._columnDefinitionObservers.push(this._columnDefinitions[this.columnCount - 1].onChangedObservable.add(() => this._markAsDirty())!);\r\n this._markAsDirty();\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Update a row definition\r\n * @param index defines the index of the row to update\r\n * @param height defines the height of the row (either in pixel or a value between 0 and 1)\r\n * @param isPixel defines if the weight is expressed in pixel (or in percentage)\r\n * @returns the current grid\r\n */\r\n public setRowDefinition(index: number, height: number, isPixel = false): Grid {\r\n if (index < 0 || index >= this._rowDefinitions.length) {\r\n return this;\r\n }\r\n\r\n const current = this._rowDefinitions[index];\r\n if (current && current.isPixel === isPixel && current.value === height) {\r\n return this;\r\n }\r\n\r\n this._rowDefinitions[index].onChangedObservable.remove(this._rowDefinitionObservers[index]);\r\n this._rowDefinitions[index] = new ValueAndUnit(height, isPixel ? ValueAndUnit.UNITMODE_PIXEL : ValueAndUnit.UNITMODE_PERCENTAGE);\r\n this._rowDefinitionObservers[index] = this._rowDefinitions[index].onChangedObservable.add(() => this._markAsDirty())!;\r\n\r\n this._markAsDirty();\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Update a column definition\r\n * @param index defines the index of the column to update\r\n * @param width defines the width of the column (either in pixel or a value between 0 and 1)\r\n * @param isPixel defines if the width is expressed in pixel (or in percentage)\r\n * @returns the current grid\r\n */\r\n public setColumnDefinition(index: number, width: number, isPixel = false): Grid {\r\n if (index < 0 || index >= this._columnDefinitions.length) {\r\n return this;\r\n }\r\n\r\n const current = this._columnDefinitions[index];\r\n if (current && current.isPixel === isPixel && current.value === width) {\r\n return this;\r\n }\r\n\r\n this._columnDefinitions[index].onChangedObservable.remove(this._columnDefinitionObservers[index]);\r\n this._columnDefinitions[index] = new ValueAndUnit(width, isPixel ? ValueAndUnit.UNITMODE_PIXEL : ValueAndUnit.UNITMODE_PERCENTAGE);\r\n this._columnDefinitionObservers[index] = this._columnDefinitions[index].onChangedObservable.add(() => this._markAsDirty())!;\r\n\r\n this._markAsDirty();\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Gets the list of children stored in a specific cell\r\n * @param row defines the row to check\r\n * @param column defines the column to check\r\n * @returns the list of controls\r\n */\r\n public getChildrenAt(row: number, column: number): Nullable<Array<Control>> {\r\n const cell = this._cells[`${row}:${column}`];\r\n\r\n if (!cell) {\r\n return null;\r\n }\r\n\r\n return cell.children;\r\n }\r\n\r\n /**\r\n * Gets a string representing the child cell info (row x column)\r\n * @param child defines the control to get info from\r\n * @returns a string containing the child cell info (row x column)\r\n */\r\n public getChildCellInfo(child: Control): string {\r\n return child._tag;\r\n }\r\n\r\n private _removeCell(cell: Container, key: string) {\r\n if (!cell) {\r\n return;\r\n }\r\n\r\n super.removeControl(cell);\r\n\r\n for (const control of cell.children) {\r\n const childIndex = this._childControls.indexOf(control);\r\n\r\n if (childIndex !== -1) {\r\n this._childControls.splice(childIndex, 1);\r\n }\r\n }\r\n\r\n delete this._cells[key];\r\n }\r\n\r\n private _offsetCell(previousKey: string, key: string) {\r\n if (!this._cells[key]) {\r\n return;\r\n }\r\n\r\n this._cells[previousKey] = this._cells[key];\r\n\r\n for (const control of this._cells[previousKey].children) {\r\n control._tag = previousKey;\r\n }\r\n\r\n delete this._cells[key];\r\n }\r\n\r\n /**\r\n * Remove a column definition at specified index\r\n * @param index defines the index of the column to remove\r\n * @returns the current grid\r\n */\r\n public removeColumnDefinition(index: number): Grid {\r\n if (index < 0 || index >= this._columnDefinitions.length) {\r\n return this;\r\n }\r\n\r\n for (let x = 0; x < this._rowDefinitions.length; x++) {\r\n const key = `${x}:${index}`;\r\n const cell = this._cells[key];\r\n\r\n this._removeCell(cell, key);\r\n }\r\n\r\n for (let x = 0; x < this._rowDefinitions.length; x++) {\r\n for (let y = index + 1; y < this._columnDefinitions.length; y++) {\r\n const previousKey = `${x}:${y - 1}`;\r\n const key = `${x}:${y}`;\r\n\r\n this._offsetCell(previousKey, key);\r\n }\r\n }\r\n\r\n this._columnDefinitions[index].onChangedObservable.remove(this._columnDefinitionObservers[index]);\r\n this._columnDefinitions.splice(index, 1);\r\n this._columnDefinitionObservers.splice(index, 1);\r\n\r\n this._markAsDirty();\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Remove a row definition at specified index\r\n * @param index defines the index of the row to remove\r\n * @returns the current grid\r\n */\r\n public removeRowDefinition(index: number): Grid {\r\n if (index < 0 || index >= this._rowDefinitions.length) {\r\n return this;\r\n }\r\n\r\n for (let y = 0; y < this._columnDefinitions.length; y++) {\r\n const key = `${index}:${y}`;\r\n const cell = this._cells[key];\r\n\r\n this._removeCell(cell, key);\r\n }\r\n\r\n for (let y = 0; y < this._columnDefinitions.length; y++) {\r\n for (let x = index + 1; x < this._rowDefinitions.length; x++) {\r\n const previousKey = `${x - 1}:${y}`;\r\n const key = `${x}:${y}`;\r\n\r\n this._offsetCell(previousKey, key);\r\n }\r\n }\r\n\r\n this._rowDefinitions[index].onChangedObservable.remove(this._rowDefinitionObservers[index]);\r\n this._rowDefinitions.splice(index, 1);\r\n this._rowDefinitionObservers.splice(index, 1);\r\n\r\n this._markAsDirty();\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Adds a new control to the current grid\r\n * @param control defines the control to add\r\n * @param row defines the row where to add the control (0 by default)\r\n * @param column defines the column where to add the control (0 by default)\r\n * @returns the current grid\r\n */\r\n public addControl(control: Control, row: number = 0, column: number = 0): Grid {\r\n if (this._rowDefinitions.length === 0) {\r\n // Add default row definition\r\n this.addRowDefinition(1, false);\r\n }\r\n\r\n if (this._columnDefinitions.length === 0) {\r\n // Add default column definition\r\n this.addColumnDefinition(1, false);\r\n }\r\n\r\n if (this._childControls.indexOf(control) !== -1) {\r\n Tools.Warn(`Control (Name:${control.name}, UniqueId:${control.uniqueId}) is already associated with this grid. You must remove it before reattaching it`);\r\n return this;\r\n }\r\n\r\n const x = Math.min(row, this._rowDefinitions.length - 1);\r\n const y = Math.min(column, this._columnDefinitions.length - 1);\r\n const key = `${x}:${y}`;\r\n let goodContainer = this._cells[key];\r\n\r\n if (!goodContainer) {\r\n goodContainer = new Container(key);\r\n this._cells[key] = goodContainer;\r\n goodContainer.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n goodContainer.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n goodContainer.clipContent = this.clipContent;\r\n goodContainer.clipChildren = this.clipChildren;\r\n super.addControl(goodContainer);\r\n }\r\n\r\n goodContainer.addControl(control);\r\n this._childControls.push(control);\r\n control._tag = key;\r\n control.parent = this;\r\n\r\n this._markAsDirty();\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Removes a control from the current container\r\n * @param control defines the control to remove\r\n * @returns the current container\r\n */\r\n public removeControl(control: Control): Container {\r\n const index = this._childControls.indexOf(control);\r\n\r\n if (index !== -1) {\r\n this._childControls.splice(index, 1);\r\n }\r\n\r\n const cell = this._cells[control._tag];\r\n\r\n if (cell) {\r\n cell.removeControl(control);\r\n control._tag = null;\r\n }\r\n\r\n this._markAsDirty();\r\n return this;\r\n }\r\n\r\n /**\r\n * Creates a new Grid\r\n * @param name defines control name\r\n */\r\n constructor(public name?: string) {\r\n super(name);\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"Grid\";\r\n }\r\n\r\n protected _getGridDefinitions(definitionCallback: (lefts: number[], tops: number[], widths: number[], heights: number[]) => void) {\r\n const widths = [];\r\n const heights = [];\r\n const lefts = [];\r\n const tops = [];\r\n\r\n let availableWidth = this._currentMeasure.width;\r\n let globalWidthPercentage = 0;\r\n let availableHeight = this._currentMeasure.height;\r\n let globalHeightPercentage = 0;\r\n\r\n // Heights\r\n let index = 0;\r\n for (const rowDefinition of this._rowDefinitions) {\r\n if (rowDefinition.isPixel) {\r\n const height = rowDefinition.getValue(this._host);\r\n availableHeight -= height;\r\n heights[index] = height;\r\n } else {\r\n globalHeightPercentage += rowDefinition.value;\r\n }\r\n index++;\r\n }\r\n\r\n let top = 0;\r\n index = 0;\r\n for (const rowDefinition of this._rowDefinitions) {\r\n tops.push(top);\r\n\r\n if (!rowDefinition.isPixel) {\r\n const height = Math.round((rowDefinition.value / globalHeightPercentage) * availableHeight);\r\n top += height;\r\n heights[index] = height;\r\n } else {\r\n top += rowDefinition.getValue(this._host);\r\n }\r\n index++;\r\n }\r\n\r\n // Widths\r\n index = 0;\r\n for (const columnDefinition of this._columnDefinitions) {\r\n if (columnDefinition.isPixel) {\r\n const width = columnDefinition.getValue(this._host);\r\n availableWidth -= width;\r\n widths[index] = width;\r\n } else {\r\n globalWidthPercentage += columnDefinition.value;\r\n }\r\n index++;\r\n }\r\n\r\n let left = 0;\r\n index = 0;\r\n for (const columnDefinition of this._columnDefinitions) {\r\n lefts.push(left);\r\n if (!columnDefinition.isPixel) {\r\n const width = Math.round((columnDefinition.value / globalWidthPercentage) * availableWidth);\r\n left += width;\r\n widths[index] = width;\r\n } else {\r\n left += columnDefinition.getValue(this._host);\r\n }\r\n index++;\r\n }\r\n\r\n definitionCallback(lefts, tops, widths, heights);\r\n }\r\n\r\n protected _additionalProcessing(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n this._getGridDefinitions((lefts: number[], tops: number[], widths: number[], heights: number[]) => {\r\n // Setting child sizes\r\n for (const key in this._cells) {\r\n if (!Object.prototype.hasOwnProperty.call(this._cells, key)) {\r\n continue;\r\n }\r\n const split = key.split(\":\");\r\n const x = parseInt(split[0]);\r\n const y = parseInt(split[1]);\r\n const cell = this._cells[key];\r\n\r\n cell.leftInPixels = lefts[y];\r\n cell.topInPixels = tops[x];\r\n cell.widthInPixels = widths[y];\r\n cell.heightInPixels = heights[x];\r\n cell._left.ignoreAdaptiveScaling = true;\r\n cell._top.ignoreAdaptiveScaling = true;\r\n cell._width.ignoreAdaptiveScaling = true;\r\n cell._height.ignoreAdaptiveScaling = true;\r\n }\r\n });\r\n\r\n super._additionalProcessing(parentMeasure, context);\r\n }\r\n\r\n public _flagDescendantsAsMatrixDirty(): void {\r\n for (const key in this._cells) {\r\n if (!Object.prototype.hasOwnProperty.call(this._cells, key)) {\r\n continue;\r\n }\r\n\r\n const child = this._cells[key];\r\n child._markMatrixAsDirty();\r\n }\r\n }\r\n\r\n public _renderHighlightSpecific(context: ICanvasRenderingContext): void {\r\n super._renderHighlightSpecific(context);\r\n\r\n this._getGridDefinitions((lefts: number[], tops: number[], widths: number[], heights: number[]) => {\r\n // Columns\r\n for (let index = 0; index < lefts.length; index++) {\r\n const left = this._currentMeasure.left + lefts[index] + widths[index];\r\n context.beginPath();\r\n context.moveTo(left, this._currentMeasure.top);\r\n context.lineTo(left, this._currentMeasure.top + this._currentMeasure.height);\r\n context.stroke();\r\n }\r\n\r\n // Rows\r\n for (let index = 0; index < tops.length; index++) {\r\n const top = this._currentMeasure.top + tops[index] + heights[index];\r\n context.beginPath();\r\n context.moveTo(this._currentMeasure.left, top);\r\n context.lineTo(this._currentMeasure.left + this._currentMeasure.width, top);\r\n context.stroke();\r\n }\r\n });\r\n\r\n context.restore();\r\n }\r\n\r\n /** Releases associated resources */\r\n public dispose() {\r\n super.dispose();\r\n\r\n for (const control of this._childControls) {\r\n control.dispose();\r\n }\r\n for (let index = 0; index < this._rowDefinitions.length; index++) {\r\n this._rowDefinitions[index].onChangedObservable.remove(this._rowDefinitionObservers[index]);\r\n }\r\n for (let index = 0; index < this._columnDefinitions.length; index++) {\r\n this._columnDefinitions[index].onChangedObservable.remove(this._columnDefinitionObservers[index]);\r\n }\r\n this._rowDefinitionObservers.length = 0;\r\n this._rowDefinitions.length = 0;\r\n this._columnDefinitionObservers.length = 0;\r\n this._columnDefinitions.length = 0;\r\n this._cells = {};\r\n this._childControls.length = 0;\r\n }\r\n\r\n /**\r\n * Serializes the current control\r\n * @param serializationObject defined the JSON serialized object\r\n */\r\n public serialize(serializationObject: any) {\r\n super.serialize(serializationObject);\r\n serializationObject.columnCount = this.columnCount;\r\n serializationObject.rowCount = this.rowCount;\r\n serializationObject.columns = [];\r\n serializationObject.rows = [];\r\n serializationObject.tags = [];\r\n for (let i = 0; i < this.columnCount; ++i) {\r\n const cd = this.getColumnDefinition(i);\r\n const childSerializationObject = { value: cd?.getValue(this.host), unit: cd?.unit };\r\n serializationObject.columns.push(childSerializationObject);\r\n }\r\n for (let i = 0; i < this.rowCount; ++i) {\r\n const rd = this.getRowDefinition(i);\r\n const childSerializationObject = { value: rd?.getValue(this.host), unit: rd?.unit };\r\n serializationObject.rows.push(childSerializationObject);\r\n }\r\n this.children.forEach((child) => {\r\n serializationObject.tags.push(child._tag);\r\n });\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _parseFromContent(serializedObject: any, host: AdvancedDynamicTexture) {\r\n super._parseFromContent(serializedObject, host);\r\n const children: Control[] = [];\r\n this.children.forEach((child) => {\r\n children.push(child);\r\n });\r\n this.removeRowDefinition(0);\r\n this.removeColumnDefinition(0);\r\n for (let i = 0; i < serializedObject.columnCount; ++i) {\r\n const columnValue = serializedObject.columns[i].value;\r\n const unit = serializedObject.columns[i].unit;\r\n this.addColumnDefinition(columnValue, unit === 1 ? true : false);\r\n }\r\n for (let i = 0; i < serializedObject.rowCount; ++i) {\r\n const rowValue = serializedObject.rows[i].value;\r\n const unit = serializedObject.rows[i].unit;\r\n this.addRowDefinition(rowValue, unit === 1 ? true : false);\r\n }\r\n\r\n for (let i = 0; i < children.length; ++i) {\r\n const cellInfo = serializedObject.tags[i];\r\n let rowNumber = parseInt(cellInfo.substring(0, cellInfo.search(\":\")));\r\n if (isNaN(rowNumber)) {\r\n rowNumber = 0;\r\n }\r\n let columnNumber = parseInt(cellInfo.substring(cellInfo.search(\":\") + 1));\r\n if (isNaN(columnNumber)) {\r\n columnNumber = 0;\r\n }\r\n this.addControl(children[i], rowNumber, columnNumber);\r\n }\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.Grid\", Grid);\r\n"]}
@@ -201,11 +201,10 @@ export class Image extends Control {
201
201
  * @internal
202
202
  */
203
203
  _rotate90(n, preserveProperties = false) {
204
- var _a, _b;
205
204
  const width = this._domImage.width;
206
205
  const height = this._domImage.height;
207
206
  // Should abstract platform instead of using LastCreatedEngine
208
- const engine = ((_b = (_a = this._host) === null || _a === void 0 ? void 0 : _a.getScene()) === null || _b === void 0 ? void 0 : _b.getEngine()) || EngineStore.LastCreatedEngine;
207
+ const engine = this._host?.getScene()?.getEngine() || EngineStore.LastCreatedEngine;
209
208
  if (!engine) {
210
209
  throw new Error("Invalid engine. Unable to create a canvas.");
211
210
  }
@@ -269,11 +268,10 @@ export class Image extends Control {
269
268
  dstImage.sourceHeight = dstHeight;
270
269
  }
271
270
  _extractNinePatchSliceDataFromImage() {
272
- var _a, _b;
273
271
  const width = this._domImage.width;
274
272
  const height = this._domImage.height;
275
273
  if (!this._workingCanvas) {
276
- const engine = ((_b = (_a = this._host) === null || _a === void 0 ? void 0 : _a.getScene()) === null || _b === void 0 ? void 0 : _b.getEngine()) || EngineStore.LastCreatedEngine;
274
+ const engine = this._host?.getScene()?.getEngine() || EngineStore.LastCreatedEngine;
277
275
  if (!engine) {
278
276
  throw new Error("Invalid engine. Unable to create a canvas.");
279
277
  }
@@ -371,7 +369,6 @@ export class Image extends Control {
371
369
  * Gets or sets image source url
372
370
  */
373
371
  set source(value) {
374
- var _a, _b;
375
372
  if (this._source === value) {
376
373
  return;
377
374
  }
@@ -383,7 +380,7 @@ export class Image extends Control {
383
380
  value = this._svgCheck(value);
384
381
  }
385
382
  // Should abstract platform instead of using LastCreatedEngine
386
- const engine = ((_b = (_a = this._host) === null || _a === void 0 ? void 0 : _a.getScene()) === null || _b === void 0 ? void 0 : _b.getEngine()) || EngineStore.LastCreatedEngine;
383
+ const engine = this._host?.getScene()?.getEngine() || EngineStore.LastCreatedEngine;
387
384
  if (!engine) {
388
385
  throw new Error("Invalid engine. Unable to create a canvas.");
389
386
  }
@@ -654,14 +651,13 @@ export class Image extends Control {
654
651
  super._processMeasures(parentMeasure, context);
655
652
  }
656
653
  _prepareWorkingCanvasForOpaqueDetection() {
657
- var _a, _b;
658
654
  if (!this._detectPointerOnOpaqueOnly) {
659
655
  return;
660
656
  }
661
657
  const width = this._currentMeasure.width;
662
658
  const height = this._currentMeasure.height;
663
659
  if (!this._workingCanvas) {
664
- const engine = ((_b = (_a = this._host) === null || _a === void 0 ? void 0 : _a.getScene()) === null || _b === void 0 ? void 0 : _b.getEngine()) || EngineStore.LastCreatedEngine;
660
+ const engine = this._host?.getScene()?.getEngine() || EngineStore.LastCreatedEngine;
665
661
  if (!engine) {
666
662
  throw new Error("Invalid engine. Unable to create a canvas.");
667
663
  }