@babylonjs/gui 7.3.1 → 7.3.3
Sign up to get free protection for your applications and to get access to all the features.
- package/2D/advancedDynamicTexture.js.map +1 -1
- package/2D/controls/button.js.map +1 -1
- package/2D/controls/checkbox.js.map +1 -1
- package/2D/controls/colorpicker.js.map +1 -1
- package/2D/controls/container.d.ts +2 -1
- package/2D/controls/container.js +4 -3
- package/2D/controls/container.js.map +1 -1
- package/2D/controls/control.d.ts +2 -1
- package/2D/controls/control.js +5 -2
- package/2D/controls/control.js.map +1 -1
- package/2D/controls/displayGrid.js.map +1 -1
- package/2D/controls/ellipse.js.map +1 -1
- package/2D/controls/focusableButton.js.map +1 -1
- package/2D/controls/gradient/LinearGradient.js.map +1 -1
- package/2D/controls/gradient/RadialGradient.js.map +1 -1
- package/2D/controls/grid.js.map +1 -1
- package/2D/controls/image.js.map +1 -1
- package/2D/controls/inputPassword.js.map +1 -1
- package/2D/controls/inputText.js.map +1 -1
- package/2D/controls/inputTextArea.js.map +1 -1
- package/2D/controls/line.js.map +1 -1
- package/2D/controls/multiLine.js.map +1 -1
- package/2D/controls/radioButton.js.map +1 -1
- package/2D/controls/rectangle.js.map +1 -1
- package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
- package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -1
- package/2D/controls/selector.js.map +1 -1
- package/2D/controls/sliders/baseSlider.js.map +1 -1
- package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
- package/2D/controls/sliders/imageScrollBar.js.map +1 -1
- package/2D/controls/sliders/scrollBar.js.map +1 -1
- package/2D/controls/sliders/slider.js.map +1 -1
- package/2D/controls/stackPanel.js.map +1 -1
- package/2D/controls/textBlock.js.map +1 -1
- package/2D/controls/toggleButton.js.map +1 -1
- package/2D/controls/virtualKeyboard.js.map +1 -1
- package/3D/controls/MRTK3/touchHolographicButton.js.map +1 -1
- package/3D/controls/abstractButton3D.js.map +1 -1
- package/3D/controls/button3D.js.map +1 -1
- package/3D/controls/container3D.js.map +1 -1
- package/3D/controls/handMenu.js.map +1 -1
- package/3D/controls/holographicBackplate.js.map +1 -1
- package/3D/controls/holographicButton.js.map +1 -1
- package/3D/controls/holographicSlate.js.map +1 -1
- package/3D/controls/meshButton3D.js.map +1 -1
- package/3D/controls/nearMenu.js.map +1 -1
- package/3D/controls/scatterPanel.js.map +1 -1
- package/3D/controls/slider3D.js.map +1 -1
- package/3D/controls/stackPanel3D.js.map +1 -1
- package/3D/controls/touchButton3D.js.map +1 -1
- package/3D/controls/touchHolographicButton.js.map +1 -1
- package/3D/controls/touchHolographicMenu.js.map +1 -1
- package/3D/controls/touchMeshButton3D.js.map +1 -1
- package/3D/controls/volumeBasedPanel.js.map +1 -1
- package/3D/gizmos/slateGizmo.js.map +1 -1
- package/3D/materials/fluent/fluentMaterial.js.map +1 -1
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
- package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
- package/3D/materials/handle/handleMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlBackglowMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlFrontplateMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlInnerquadMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
- package/package.json +2 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"displayGrid.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/controls/displayGrid.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,0CAA4B;AACpD,OAAO,EAAE,SAAS,EAAE,2CAA6B;AAGjD,mCAAmC;AACnC,MAAM,OAAO,WAAY,SAAQ,OAAO;IAiBpC,2FAA2F;IAE3F,IAAW,iBAAiB;QACxB,OAA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SAAS,EAAE;oDAGX;AAUD;IADC,SAAS,EAAE;iDAGX;AAUD;IADC,SAAS,EAAE;qDAGX;AAyFL,aAAa,CAAC,yBAAyB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { Control } from \"./control\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport type { ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\n\r\n/** Class used to render a grid */\r\nexport class DisplayGrid extends Control {\r\n private _cellWidth = 20;\r\n private _cellHeight = 20;\r\n\r\n private _minorLineTickness = 1;\r\n private _minorLineColor = \"DarkGray\";\r\n\r\n private _majorLineTickness = 2;\r\n private _majorLineColor = \"White\";\r\n\r\n private _majorLineFrequency = 5;\r\n\r\n private _background = \"Black\";\r\n\r\n private _displayMajorLines = true;\r\n private _displayMinorLines = true;\r\n\r\n /** Gets or sets a boolean indicating if minor lines must be rendered (true by default)) */\r\n @serialize()\r\n public get displayMinorLines(): boolean {\r\n return this._displayMinorLines;\r\n }\r\n\r\n public set displayMinorLines(value: boolean) {\r\n if (this._displayMinorLines === value) {\r\n return;\r\n }\r\n\r\n this._displayMinorLines = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets a boolean indicating if major lines must be rendered (true by default)) */\r\n @serialize()\r\n public get displayMajorLines(): boolean {\r\n return this._displayMajorLines;\r\n }\r\n\r\n public set displayMajorLines(value: boolean) {\r\n if (this._displayMajorLines === value) {\r\n return;\r\n }\r\n\r\n this._displayMajorLines = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets background color (Black by default) */\r\n @serialize()\r\n public get background(): string {\r\n return this._background;\r\n }\r\n\r\n public set background(value: string) {\r\n if (this._background === value) {\r\n return;\r\n }\r\n\r\n this._background = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the width of each cell (20 by default) */\r\n @serialize()\r\n public get cellWidth(): number {\r\n return this._cellWidth;\r\n }\r\n\r\n public set cellWidth(value: number) {\r\n this._cellWidth = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the height of each cell (20 by default) */\r\n @serialize()\r\n public get cellHeight(): number {\r\n return this._cellHeight;\r\n }\r\n\r\n public set cellHeight(value: number) {\r\n this._cellHeight = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the tickness of minor lines (1 by default) */\r\n @serialize()\r\n public get minorLineTickness(): number {\r\n return this._minorLineTickness;\r\n }\r\n\r\n public set minorLineTickness(value: number) {\r\n this._minorLineTickness = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the color of minor lines (DarkGray by default) */\r\n @serialize()\r\n public get minorLineColor(): string {\r\n return this._minorLineColor;\r\n }\r\n\r\n public set minorLineColor(value: string) {\r\n this._minorLineColor = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the tickness of major lines (2 by default) */\r\n @serialize()\r\n public get majorLineTickness(): number {\r\n return this._majorLineTickness;\r\n }\r\n\r\n public set majorLineTickness(value: number) {\r\n this._majorLineTickness = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the color of major lines (White by default) */\r\n @serialize()\r\n public get majorLineColor(): string {\r\n return this._majorLineColor;\r\n }\r\n\r\n public set majorLineColor(value: string) {\r\n this._majorLineColor = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the frequency of major lines (default is 1 every 5 minor lines)*/\r\n @serialize()\r\n public get majorLineFrequency(): number {\r\n return this._majorLineFrequency;\r\n }\r\n\r\n public set majorLineFrequency(value: number) {\r\n this._majorLineFrequency = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Creates a new GridDisplayRectangle\r\n * @param name defines the control name\r\n */\r\n constructor(public name?: string) {\r\n super(name);\r\n }\r\n\r\n public _draw(context: ICanvasRenderingContext): void {\r\n context.save();\r\n\r\n this._applyStates(context);\r\n\r\n if (this._isEnabled) {\r\n if (this._background) {\r\n context.fillStyle = this._background;\r\n context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n }\r\n\r\n const cellCountX = this._currentMeasure.width / this._cellWidth;\r\n const cellCountY = this._currentMeasure.height / this._cellHeight;\r\n\r\n // Minor lines\r\n const left = this._currentMeasure.left + this._currentMeasure.width / 2;\r\n const top = this._currentMeasure.top + this._currentMeasure.height / 2;\r\n\r\n if (this._displayMinorLines) {\r\n context.strokeStyle = this._minorLineColor;\r\n context.lineWidth = this._minorLineTickness;\r\n\r\n for (let x = -cellCountX / 2 + 1; x < cellCountX / 2; x++) {\r\n const cellX = left + x * this.cellWidth;\r\n\r\n context.beginPath();\r\n context.moveTo(cellX, this._currentMeasure.top);\r\n context.lineTo(cellX, this._currentMeasure.top + this._currentMeasure.height);\r\n\r\n context.stroke();\r\n }\r\n\r\n for (let y = -cellCountY / 2 + 1; y < cellCountY / 2; y++) {\r\n const cellY = top + y * this.cellHeight;\r\n\r\n context.beginPath();\r\n context.moveTo(this._currentMeasure.left, cellY);\r\n context.lineTo(this._currentMeasure.left + this._currentMeasure.width, cellY);\r\n context.stroke();\r\n }\r\n }\r\n\r\n // Major lines\r\n if (this._displayMajorLines) {\r\n context.strokeStyle = this._majorLineColor;\r\n context.lineWidth = this._majorLineTickness;\r\n\r\n for (let x = -cellCountX / 2 + this._majorLineFrequency; x < cellCountX / 2; x += this._majorLineFrequency) {\r\n const cellX = left + x * this.cellWidth;\r\n\r\n context.beginPath();\r\n context.moveTo(cellX, this._currentMeasure.top);\r\n context.lineTo(cellX, this._currentMeasure.top + this._currentMeasure.height);\r\n context.stroke();\r\n }\r\n\r\n for (let y = -cellCountY / 2 + this._majorLineFrequency; y < cellCountY / 2; y += this._majorLineFrequency) {\r\n const cellY = top + y * this.cellHeight;\r\n context.moveTo(this._currentMeasure.left, cellY);\r\n context.lineTo(this._currentMeasure.left + this._currentMeasure.width, cellY);\r\n context.closePath();\r\n context.stroke();\r\n }\r\n }\r\n }\r\n\r\n context.restore();\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"DisplayGrid\";\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.DisplayGrid\", DisplayGrid);\r\n"]}
|
1
|
+
{"version":3,"file":"displayGrid.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/controls/displayGrid.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,0CAA4B;AACpD,OAAO,EAAE,SAAS,EAAE,2CAA6B;AAGjD,mCAAmC;AACnC,MAAM,OAAO,WAAY,SAAQ,OAAO;IAiBpC,2FAA2F;IAE3F,IAAW,iBAAiB;QACxB,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACnC,CAAC;IAED,IAAW,iBAAiB,CAAC,KAAc;QACvC,IAAI,IAAI,CAAC,kBAAkB,KAAK,KAAK,EAAE;YACnC,OAAO;SACV;QAED,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAChC,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAED,2FAA2F;IAE3F,IAAW,iBAAiB;QACxB,OAAO,IAAI,CAAC,kBAAkB,CAAC;IACnC,CAAC;IAED,IAAW,iBAAiB,CAAC,KAAc;QACvC,IAAI,IAAI,CAAC,kBAAkB,KAAK,KAAK,EAAE;YACnC,OAAO;SACV;QAED,IAAI,CAAC,kBAAkB,GAAG,KAAK,CAAC;QAChC,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAED,uDAAuD;IAEvD,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,WAAW,CAAC;IAC5B,CAAC;IAED,IAAW,UAAU,CAAC,KAAa;QAC/B,IAAI,IAAI,CAAC,WAAW,KAAK,KAAK,EAAE;YAC5B,OAAO;SACV;QAED,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;QACzB,IAAI,CAAC,YAAY,EAAE,CAAC;IACx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CAAC,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;oBAC9E,OAAO,CAAC,SAAS,EAAE,CAAC;oBACpB,OAAO,CAAC,MAAM,EAAE,CAAC;iBACpB;aACJ;SACJ;QAED,OAAO,CAAC,OAAO,EAAE,CAAC;IACtB,CAAC;IAEkB,YAAY;QAC3B,OAAO,aAAa,CAAC;IACzB,CAAC;CACJ;AA/MG;IADC,SAAS,EAAE;oDAGX;AAaD;IADC,SAAS,EAAE;oDAGX;AAaD;IADC,SAAS,EAAE;6CAGX;AAaD;IADC,SAAS,EAAE;4CAGX;AAUD;IADC,SAAS,EAAE;6CAGX;AAUD;IADC,SAAS,EAAE;oDAGX;AAUD;IADC,SAAS,EAAE;iDAGX;AAUD;IADC,SAAS,EAAE;oDAGX;AAUD;IADC,SAAS,EAAE;iDAGX;AAUD;IADC,SAAS,EAAE;qDAGX;AAyFL,aAAa,CAAC,yBAAyB,EAAE,WAAW,CAAC,CAAC","sourcesContent":["import { Control } from \"./control\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport type { ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\n\r\n/** Class used to render a grid */\r\nexport class DisplayGrid extends Control {\r\n private _cellWidth = 20;\r\n private _cellHeight = 20;\r\n\r\n private _minorLineTickness = 1;\r\n private _minorLineColor = \"DarkGray\";\r\n\r\n private _majorLineTickness = 2;\r\n private _majorLineColor = \"White\";\r\n\r\n private _majorLineFrequency = 5;\r\n\r\n private _background = \"Black\";\r\n\r\n private _displayMajorLines = true;\r\n private _displayMinorLines = true;\r\n\r\n /** Gets or sets a boolean indicating if minor lines must be rendered (true by default)) */\r\n @serialize()\r\n public get displayMinorLines(): boolean {\r\n return this._displayMinorLines;\r\n }\r\n\r\n public set displayMinorLines(value: boolean) {\r\n if (this._displayMinorLines === value) {\r\n return;\r\n }\r\n\r\n this._displayMinorLines = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets a boolean indicating if major lines must be rendered (true by default)) */\r\n @serialize()\r\n public get displayMajorLines(): boolean {\r\n return this._displayMajorLines;\r\n }\r\n\r\n public set displayMajorLines(value: boolean) {\r\n if (this._displayMajorLines === value) {\r\n return;\r\n }\r\n\r\n this._displayMajorLines = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets background color (Black by default) */\r\n @serialize()\r\n public get background(): string {\r\n return this._background;\r\n }\r\n\r\n public set background(value: string) {\r\n if (this._background === value) {\r\n return;\r\n }\r\n\r\n this._background = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the width of each cell (20 by default) */\r\n @serialize()\r\n public get cellWidth(): number {\r\n return this._cellWidth;\r\n }\r\n\r\n public set cellWidth(value: number) {\r\n this._cellWidth = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the height of each cell (20 by default) */\r\n @serialize()\r\n public get cellHeight(): number {\r\n return this._cellHeight;\r\n }\r\n\r\n public set cellHeight(value: number) {\r\n this._cellHeight = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the tickness of minor lines (1 by default) */\r\n @serialize()\r\n public get minorLineTickness(): number {\r\n return this._minorLineTickness;\r\n }\r\n\r\n public set minorLineTickness(value: number) {\r\n this._minorLineTickness = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the color of minor lines (DarkGray by default) */\r\n @serialize()\r\n public get minorLineColor(): string {\r\n return this._minorLineColor;\r\n }\r\n\r\n public set minorLineColor(value: string) {\r\n this._minorLineColor = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the tickness of major lines (2 by default) */\r\n @serialize()\r\n public get majorLineTickness(): number {\r\n return this._majorLineTickness;\r\n }\r\n\r\n public set majorLineTickness(value: number) {\r\n this._majorLineTickness = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the color of major lines (White by default) */\r\n @serialize()\r\n public get majorLineColor(): string {\r\n return this._majorLineColor;\r\n }\r\n\r\n public set majorLineColor(value: string) {\r\n this._majorLineColor = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the frequency of major lines (default is 1 every 5 minor lines)*/\r\n @serialize()\r\n public get majorLineFrequency(): number {\r\n return this._majorLineFrequency;\r\n }\r\n\r\n public set majorLineFrequency(value: number) {\r\n this._majorLineFrequency = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Creates a new GridDisplayRectangle\r\n * @param name defines the control name\r\n */\r\n constructor(public override name?: string) {\r\n super(name);\r\n }\r\n\r\n public override _draw(context: ICanvasRenderingContext): void {\r\n context.save();\r\n\r\n this._applyStates(context);\r\n\r\n if (this._isEnabled) {\r\n if (this._background) {\r\n context.fillStyle = this._background;\r\n context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n }\r\n\r\n const cellCountX = this._currentMeasure.width / this._cellWidth;\r\n const cellCountY = this._currentMeasure.height / this._cellHeight;\r\n\r\n // Minor lines\r\n const left = this._currentMeasure.left + this._currentMeasure.width / 2;\r\n const top = this._currentMeasure.top + this._currentMeasure.height / 2;\r\n\r\n if (this._displayMinorLines) {\r\n context.strokeStyle = this._minorLineColor;\r\n context.lineWidth = this._minorLineTickness;\r\n\r\n for (let x = -cellCountX / 2 + 1; x < cellCountX / 2; x++) {\r\n const cellX = left + x * this.cellWidth;\r\n\r\n context.beginPath();\r\n context.moveTo(cellX, this._currentMeasure.top);\r\n context.lineTo(cellX, this._currentMeasure.top + this._currentMeasure.height);\r\n\r\n context.stroke();\r\n }\r\n\r\n for (let y = -cellCountY / 2 + 1; y < cellCountY / 2; y++) {\r\n const cellY = top + y * this.cellHeight;\r\n\r\n context.beginPath();\r\n context.moveTo(this._currentMeasure.left, cellY);\r\n context.lineTo(this._currentMeasure.left + this._currentMeasure.width, cellY);\r\n context.stroke();\r\n }\r\n }\r\n\r\n // Major lines\r\n if (this._displayMajorLines) {\r\n context.strokeStyle = this._majorLineColor;\r\n context.lineWidth = this._majorLineTickness;\r\n\r\n for (let x = -cellCountX / 2 + this._majorLineFrequency; x < cellCountX / 2; x += this._majorLineFrequency) {\r\n const cellX = left + x * this.cellWidth;\r\n\r\n context.beginPath();\r\n context.moveTo(cellX, this._currentMeasure.top);\r\n context.lineTo(cellX, this._currentMeasure.top + this._currentMeasure.height);\r\n context.stroke();\r\n }\r\n\r\n for (let y = -cellCountY / 2 + this._majorLineFrequency; y < cellCountY / 2; y += this._majorLineFrequency) {\r\n const cellY = top + y * this.cellHeight;\r\n context.moveTo(this._currentMeasure.left, cellY);\r\n context.lineTo(this._currentMeasure.left + this._currentMeasure.width, cellY);\r\n context.closePath();\r\n context.stroke();\r\n }\r\n }\r\n }\r\n\r\n context.restore();\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"DisplayGrid\";\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.DisplayGrid\", DisplayGrid);\r\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ellipse.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/controls/ellipse.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,aAAa,EAAE,0CAA4B;AACpD,OAAO,EAAE,SAAS,EAAE,2CAA6B;AAGjD,iDAAiD;AACjD,MAAM,OAAO,OAAQ,SAAQ,SAAS;IAGlC,oCAAoC;IAEpC,IAAW,SAAS;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC;IAC3B,CAAC;IAED,IAAW,SAAS,CAAC,KAAa;QAC9B,IAAI,IAAI,CAAC,UAAU,KAAK,KAAK,EAAE;YAC3B,OAAO;SACV;QAED,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAED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I,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC;QACvD,IAAI,CAAC,mBAAmB,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC;QACjD,IAAI,CAAC,mBAAmB,CAAC,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC;IACpD,CAAC;IAEkB,gBAAgB,CAAC,OAAgC;QAChE,OAAO,CAAC,WAAW,CACf,IAAI,CAAC,eAAe,CAAC,IAAI,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,GAAG,CAAC,EAC1D,IAAI,CAAC,eAAe,CAAC,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAC1D,IAAI,CAAC,eAAe,CAAC,KAAK,GAAG,CAAC,EAC9B,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAC/B,OAAO,CACV,CAAC;QAEF,OAAO,CAAC,IAAI,EAAE,CAAC;IACnB,CAAC;IAEe,wBAAwB,CAAC,OAAgC;QACrE,OAAO,CAAC,WAAW,CACf,IAAI,CAAC,eAAe,CAAC,IAAI,GAAG,IAAI,CAAC,eAAe,CAAC,KAAK,GAAG,CAAC,EAC1D,IAAI,CAAC,eAAe,CAAC,GAAG,GAAG,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,EAC1D,IAAI,CAAC,eAAe,CAAC,KAAK,GAAG,CAAC,GAAG,IAAI,CAAC,mBAAmB,GAAG,CAAC,EAC7D,IAAI,CAAC,eAAe,CAAC,MAAM,GAAG,CAAC,GAAG,IAAI,CAAC,mBAAmB,GAAG,CAAC,EAC9D,OAAO,CACV,CAAC;QACF,OAAO,CAAC,MAAM,EAAE,CAAC;IACrB,CAAC;CACJ;AAlGG;IADC,SAAS,EAAE;wCAGX;AAiGL,aAAa,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC","sourcesContent":["import { Container } from \"./container\";\r\nimport { Control } from \"./control\";\r\nimport type { Measure } from \"../measure\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport type { ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\n\r\n/** Class used to create 2D ellipse containers */\r\nexport class Ellipse extends Container {\r\n private _thickness = 1;\r\n\r\n /** Gets or sets border thickness */\r\n @serialize()\r\n public get thickness(): number {\r\n return this._thickness;\r\n }\r\n\r\n public set thickness(value: number) {\r\n if (this._thickness === value) {\r\n return;\r\n }\r\n\r\n this._thickness = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Creates a new Ellipse\r\n * @param name defines the control name\r\n */\r\n constructor(public override name?: string) {\r\n super(name);\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"Ellipse\";\r\n }\r\n\r\n protected override _localDraw(context: ICanvasRenderingContext): void {\r\n context.save();\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowColor = this.shadowColor;\r\n context.shadowBlur = this.shadowBlur;\r\n context.shadowOffsetX = this.shadowOffsetX;\r\n context.shadowOffsetY = this.shadowOffsetY;\r\n }\r\n\r\n Control.drawEllipse(\r\n this._currentMeasure.left + this._currentMeasure.width / 2,\r\n this._currentMeasure.top + this._currentMeasure.height / 2,\r\n this._currentMeasure.width / 2 - this._thickness / 2,\r\n this._currentMeasure.height / 2 - this._thickness / 2,\r\n context\r\n );\r\n\r\n if (this._backgroundGradient || this._background) {\r\n context.fillStyle = this._getBackgroundColor(context);\r\n\r\n context.fill();\r\n }\r\n\r\n if (this.shadowBlur || this.shadowOffsetX || this.shadowOffsetY) {\r\n context.shadowBlur = 0;\r\n context.shadowOffsetX = 0;\r\n context.shadowOffsetY = 0;\r\n }\r\n\r\n if (this._thickness) {\r\n if (this.color) {\r\n context.strokeStyle = this.color;\r\n }\r\n context.lineWidth = this._thickness;\r\n\r\n context.stroke();\r\n }\r\n\r\n context.restore();\r\n }\r\n\r\n protected override _additionalProcessing(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n super._additionalProcessing(parentMeasure, context);\r\n\r\n this._measureForChildren.width -= 2 * this._thickness;\r\n this._measureForChildren.height -= 2 * this._thickness;\r\n this._measureForChildren.left += this._thickness;\r\n this._measureForChildren.top += this._thickness;\r\n }\r\n\r\n protected override _clipForChildren(context: ICanvasRenderingContext) {\r\n Control.drawEllipse(\r\n this._currentMeasure.left + this._currentMeasure.width / 2,\r\n this._currentMeasure.top + this._currentMeasure.height / 2,\r\n this._currentMeasure.width / 2,\r\n this._currentMeasure.height / 2,\r\n context\r\n );\r\n\r\n context.clip();\r\n }\r\n\r\n public override _renderHighlightSpecific(context: ICanvasRenderingContext): void {\r\n Control.drawEllipse(\r\n this._currentMeasure.left + this._currentMeasure.width / 2,\r\n this._currentMeasure.top + this._currentMeasure.height / 2,\r\n this._currentMeasure.width / 2 - this._highlightLineWidth / 2,\r\n this._currentMeasure.height / 2 - this._highlightLineWidth / 2,\r\n context\r\n );\r\n context.stroke();\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.Ellipse\", Ellipse);\r\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"focusableButton.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/controls/focusableButton.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAGpD,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAGlD;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,MAAM;IAavC,
|
1
|
+
{"version":3,"file":"focusableButton.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/controls/focusableButton.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAGpD,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAGlD;;;GAGG;AACH,MAAM,OAAO,eAAgB,SAAQ,MAAM;IAavC,YAA4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AEG;IACI,IAAI;QACP,IAAI,CAAC,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC;IACrC,CAAC;IAED;;;OAGG;IACI,eAAe,CAAC,GAAmB;QACtC,IAAI,CAAC,kCAAkC,CAAC,eAAe,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAC3E,CAAC;IAED;;OAEG;IACa,cAAc,CAAC,MAAe,EAAE,WAAoB,EAAE,SAAiB,EAAE,WAAmB,EAAE,EAAmB;QAC7H,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YAClB,kCAAkC;YAClC,IAAI,CAAC,KAAK,EAAE,CAAC;SAChB;QAED,OAAO,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC;IACjF,CAAC;IAED,gBAAgB;IACA,OAAO;QACnB,KAAK,CAAC,OAAO,EAAE,CAAC;QAEhB,IAAI,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC;QAC9B,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;QAC/B,IAAI,CAAC,kCAAkC,CAAC,KAAK,EAAE,CAAC;IACpD,CAAC;CACJ;AACD,aAAa,CAAC,6BAA6B,EAAE,eAAe,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { Vector2 } from \"core/Maths/math.vector\";\r\n\r\nimport { Button } from \"./button\";\r\nimport type { Control } from \"./control\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { PointerInfoBase } from \"core/Events/pointerEvents\";\r\nimport type { IFocusableControl } from \"./focusableControl\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport type { IKeyboardEvent } from \"core/Events/deviceInputEvents\";\r\n\r\n/**\r\n * Class used to create a focusable button that can easily handle keyboard events\r\n * @since 5.0.0\r\n */\r\nexport class FocusableButton extends Button implements IFocusableControl {\r\n /** Highlight color when button is focused */\r\n public focusedColor: Nullable<string> = null;\r\n private _isFocused = false;\r\n private _unfocusedColor: Nullable<string> = null;\r\n\r\n /** Observable raised when the control gets the focus */\r\n public onFocusObservable = new Observable<Button>();\r\n /** Observable raised when the control loses the focus */\r\n public onBlurObservable = new Observable<Button>();\r\n /** Observable raised when a key event was processed */\r\n public onKeyboardEventProcessedObservable = new Observable<IKeyboardEvent>();\r\n\r\n constructor(public override name?: string) {\r\n super(name);\r\n\r\n this._unfocusedColor = this.color;\r\n }\r\n\r\n /** @internal */\r\n public onBlur(): void {\r\n if (this._isFocused) {\r\n this._isFocused = false;\r\n if (this.focusedColor && this._unfocusedColor != null) {\r\n // Set color back to saved unfocused color\r\n this.color = this._unfocusedColor;\r\n }\r\n this.onBlurObservable.notifyObservers(this);\r\n }\r\n }\r\n\r\n /** @internal */\r\n public onFocus(): void {\r\n this._isFocused = true;\r\n\r\n if (this.focusedColor) {\r\n // Save the unfocused color\r\n this._unfocusedColor = this.color;\r\n this.color = this.focusedColor;\r\n }\r\n this.onFocusObservable.notifyObservers(this);\r\n }\r\n\r\n /**\r\n * Function called to get the list of controls that should not steal the focus from this control\r\n * @returns an array of controls\r\n */\r\n public keepsFocusWith(): Nullable<Control[]> {\r\n return null;\r\n }\r\n\r\n /**\r\n * Function to focus a button programmatically\r\n */\r\n public focus() {\r\n this._host.moveFocusToControl(this);\r\n }\r\n\r\n /**\r\n * Function to unfocus a button programmatically\r\n */\r\n public blur() {\r\n this._host.focusedControl = null;\r\n }\r\n\r\n /**\r\n * Handles the keyboard event\r\n * @param evt Defines the KeyboardEvent\r\n */\r\n public processKeyboard(evt: IKeyboardEvent): void {\r\n this.onKeyboardEventProcessedObservable.notifyObservers(evt, -1, this);\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public override _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean {\r\n if (!this.isReadOnly) {\r\n // Clicking on button should focus\r\n this.focus();\r\n }\r\n\r\n return super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi);\r\n }\r\n\r\n /** @internal */\r\n public override dispose() {\r\n super.dispose();\r\n\r\n this.onBlurObservable.clear();\r\n this.onFocusObservable.clear();\r\n this.onKeyboardEventProcessedObservable.clear();\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.FocusableButton\", FocusableButton);\r\n"]}
|
@@ -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,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;
|
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;IACa,YAAY;QACxB,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACa,SAAS,CAAC,mBAAwB;QAC9C,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;IACa,KAAK,CAAC,mBAAwB;QAC1C,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 override 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 override 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 override 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 +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,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;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,EAAE,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IACpG,CAAC;IAED,gDAAgD;IAChD,IAAW,EAAE;QACT,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,iDAAiD;IACjD,IAAW,EAAE;QACT,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,gDAAgD;IAChD,IAAW,EAAE;QACT,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,iDAAiD;IACjD,IAAW,EAAE;QACT,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,iCAAiC;IACjC,IAAW,EAAE;QACT,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED,kCAAkC;IAClC,IAAW,EAAE;QACT,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED;;;OAGG;
|
1
|
+
{"version":3,"file":"RadialGradient.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/2D/controls/gradient/RadialGradient.ts"],"names":[],"mappings":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kC;IAClC,IAAW,EAAE;QACT,OAAO,IAAI,CAAC,GAAG,CAAC;IACpB,CAAC;IAED;;;OAGG;IACa,YAAY;QACxB,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IAED;;;OAGG;IACa,SAAS,CAAC,mBAAwB;QAC9C,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;IACa,KAAK,CAAC,mBAAwB;QAC1C,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 override 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 override 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 override 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"]}
|
package/2D/controls/grid.js.map
CHANGED
@@ -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,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;;;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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 * @param force force serialization even if isSerializable === false\r\n */\r\n public serialize(serializationObject: any, force: boolean) {\r\n super.serialize(serializationObject, force);\r\n if (!this.isSerializable && !force) {\r\n return;\r\n }\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,EAA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Q,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;AAnkBG;IADC,SAAS,EAAE;uCAGX;AAkkBL,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 override 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 override 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 override 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 override 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 override 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 override 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 override 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 override name?: string) {\r\n super(name);\r\n }\r\n\r\n protected override _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 override _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 override _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 override _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 override 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 * @param force force serialization even if isSerializable === false\r\n */\r\n public override serialize(serializationObject: any, force: boolean) {\r\n super.serialize(serializationObject, force);\r\n if (!this.isSerializable && !force) {\r\n return;\r\n }\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 override _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"]}
|