@babylonjs/gui 7.34.3 → 7.35.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. package/2D/FrameGraph/guiTask.js.map +1 -1
  2. package/2D/FrameGraph/renderGraphGUIBlock.js.map +1 -1
  3. package/2D/adtInstrumentation.js.map +1 -1
  4. package/2D/advancedDynamicTexture.d.ts +1 -1
  5. package/2D/advancedDynamicTexture.js.map +1 -1
  6. package/2D/controls/button.js.map +1 -1
  7. package/2D/controls/checkbox.js.map +1 -1
  8. package/2D/controls/colorpicker.js.map +1 -1
  9. package/2D/controls/container.js.map +1 -1
  10. package/2D/controls/control.js.map +1 -1
  11. package/2D/controls/displayGrid.js.map +1 -1
  12. package/2D/controls/ellipse.js.map +1 -1
  13. package/2D/controls/focusableButton.js.map +1 -1
  14. package/2D/controls/gradient/BaseGradient.js.map +1 -1
  15. package/2D/controls/grid.js.map +1 -1
  16. package/2D/controls/image.js.map +1 -1
  17. package/2D/controls/inputPassword.js.map +1 -1
  18. package/2D/controls/inputText.js.map +1 -1
  19. package/2D/controls/inputTextArea.js.map +1 -1
  20. package/2D/controls/line.js.map +1 -1
  21. package/2D/controls/multiLine.js.map +1 -1
  22. package/2D/controls/radioButton.js.map +1 -1
  23. package/2D/controls/rectangle.js.map +1 -1
  24. package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
  25. package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -1
  26. package/2D/controls/selector.js.map +1 -1
  27. package/2D/controls/sliders/baseSlider.js.map +1 -1
  28. package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
  29. package/2D/controls/sliders/imageScrollBar.js.map +1 -1
  30. package/2D/controls/sliders/scrollBar.js.map +1 -1
  31. package/2D/controls/sliders/slider.js.map +1 -1
  32. package/2D/controls/stackPanel.js.map +1 -1
  33. package/2D/controls/statics.js.map +1 -1
  34. package/2D/controls/textBlock.js.map +1 -1
  35. package/2D/controls/textWrapper.js.map +1 -1
  36. package/2D/controls/toggleButton.js.map +1 -1
  37. package/2D/controls/virtualKeyboard.js.map +1 -1
  38. package/2D/math2D.js.map +1 -1
  39. package/2D/measure.js.map +1 -1
  40. package/2D/multiLinePoint.js.map +1 -1
  41. package/2D/style.js.map +1 -1
  42. package/2D/valueAndUnit.js.map +1 -1
  43. package/2D/xmlLoader.js.map +1 -1
  44. package/3D/behaviors/defaultBehavior.js.map +1 -1
  45. package/3D/controls/MRTK3/touchHolographicButton.js.map +1 -1
  46. package/3D/controls/button3D.js.map +1 -1
  47. package/3D/controls/container3D.js.map +1 -1
  48. package/3D/controls/contentDisplay3D.js.map +1 -1
  49. package/3D/controls/control3D.js.map +1 -1
  50. package/3D/controls/cylinderPanel.js.map +1 -1
  51. package/3D/controls/holographicBackplate.js.map +1 -1
  52. package/3D/controls/holographicButton.js.map +1 -1
  53. package/3D/controls/holographicSlate.js.map +1 -1
  54. package/3D/controls/meshButton3D.js.map +1 -1
  55. package/3D/controls/nearMenu.js.map +1 -1
  56. package/3D/controls/planePanel.js.map +1 -1
  57. package/3D/controls/scatterPanel.js.map +1 -1
  58. package/3D/controls/slider3D.js.map +1 -1
  59. package/3D/controls/spherePanel.js.map +1 -1
  60. package/3D/controls/stackPanel3D.js.map +1 -1
  61. package/3D/controls/touchButton3D.js.map +1 -1
  62. package/3D/controls/touchHolographicButton.js.map +1 -1
  63. package/3D/controls/touchHolographicMenu.js.map +1 -1
  64. package/3D/controls/touchMeshButton3D.js.map +1 -1
  65. package/3D/controls/volumeBasedPanel.js.map +1 -1
  66. package/3D/gizmos/gizmoHandle.js.map +1 -1
  67. package/3D/gizmos/slateGizmo.js.map +1 -1
  68. package/3D/gui3DManager.js.map +1 -1
  69. package/3D/materials/fluent/fluentMaterial.js.map +1 -1
  70. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
  71. package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
  72. package/3D/materials/handle/handleMaterial.js.map +1 -1
  73. package/3D/materials/mrdl/mrdlBackglowMaterial.js.map +1 -1
  74. package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
  75. package/3D/materials/mrdl/mrdlFrontplateMaterial.js.map +1 -1
  76. package/3D/materials/mrdl/mrdlInnerquadMaterial.js.map +1 -1
  77. package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
  78. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
  79. package/legacy/legacy.js.map +1 -1
  80. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"selector.js","sourceRoot":"","sources":["../../../../../dev/gui/src/2D/controls/selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;GAEG;AACH,MAAM,OAAO,aAAa;IAKtB;;;OAGG;IACH;IACI,4BAA4B;IACrB,IAAY;QAAZ,SAAI,GAAJ,IAAI,CAAQ;QAVf,gBAAW,GAAG,IAAI,UAAU,EAAE,CAAC;QAC/B,eAAU,GAAiB,IAAI,KAAK,EAAE,CAAC;QAW3C,IAAI,CAAC,WAAW,CAAC,iBAAiB,GAAG,OAAO,CAAC,sBAAsB,CAAC;QACpE,IAAI,CAAC,WAAW,CAAC,mBAAmB,GAAG,OAAO,CAAC,yBAAyB,CAAC;QACzE,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC;IAED,gDAAgD;IAChD,IAAW,UAAU;Q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AAO,GAAG,CAAC,IAAI,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE;YAC/C,OAAO;SACV;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACtB,KAAM,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC9E,CAAC;CACJ","sourcesContent":["import { Rectangle } from \"./rectangle\";\r\nimport { StackPanel } from \"./stackPanel\";\r\nimport { Control } from \"./control\";\r\nimport { TextBlock } from \"./textBlock\";\r\nimport { Checkbox } from \"./checkbox\";\r\nimport { RadioButton } from \"./radioButton\";\r\nimport { Slider } from \"./sliders/slider\";\r\nimport { Container } from \"./container\";\r\n\r\n/** Class used to create a RadioGroup\r\n * which contains groups of radio buttons\r\n */\r\nexport class SelectorGroup {\r\n private _groupPanel = new StackPanel();\r\n private _selectors: StackPanel[] = new Array();\r\n private _groupHeader: TextBlock;\r\n\r\n /**\r\n * Creates a new SelectorGroup\r\n * @param name of group, used as a group heading\r\n */\r\n constructor(\r\n /** name of SelectorGroup */\r\n public name: string\r\n ) {\r\n this._groupPanel.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n this._groupPanel.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n this._groupHeader = this._addGroupHeader(name);\r\n }\r\n\r\n /** Gets the groupPanel of the SelectorGroup */\r\n public get groupPanel(): StackPanel {\r\n return this._groupPanel;\r\n }\r\n\r\n /** Gets the selectors array */\r\n public get selectors(): StackPanel[] {\r\n return this._selectors;\r\n }\r\n\r\n /** Gets and sets the group header */\r\n public get header() {\r\n return this._groupHeader.text;\r\n }\r\n\r\n public set header(label: string) {\r\n if (this._groupHeader.text === \"label\") {\r\n return;\r\n }\r\n\r\n this._groupHeader.text = label;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n private _addGroupHeader(text: string): TextBlock {\r\n const groupHeading = new TextBlock(\"groupHead\", text);\r\n groupHeading.width = 0.9;\r\n groupHeading.height = \"30px\";\r\n groupHeading.textWrapping = true;\r\n groupHeading.color = \"black\";\r\n groupHeading.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n groupHeading.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n groupHeading.left = \"2px\";\r\n this._groupPanel.addControl(groupHeading);\r\n return groupHeading;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _getSelector(selectorNb: number) {\r\n if (selectorNb < 0 || selectorNb >= this._selectors.length) {\r\n return;\r\n }\r\n return this._selectors[selectorNb];\r\n }\r\n\r\n /** Removes the selector at the given position\r\n * @param selectorNb the position of the selector within the group\r\n */\r\n public removeSelector(selectorNb: number) {\r\n if (selectorNb < 0 || selectorNb >= this._selectors.length) {\r\n return;\r\n }\r\n this._groupPanel.removeControl(this._selectors[selectorNb]);\r\n this._selectors.splice(selectorNb, 1);\r\n }\r\n}\r\n\r\n/** Class used to create a CheckboxGroup\r\n * which contains groups of checkbox buttons\r\n */\r\nexport class CheckboxGroup extends SelectorGroup {\r\n /** Adds a checkbox as a control\r\n * @param text is the label for the selector\r\n * @param func is the function called when the Selector is checked\r\n * @param checked is true when Selector is checked\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public addCheckbox(text: string, func = (s: boolean) => {}, checked: boolean = false): void {\r\n checked = checked || false;\r\n const button = new Checkbox();\r\n button.width = \"20px\";\r\n button.height = \"20px\";\r\n button.color = \"#364249\";\r\n button.background = \"#CCCCCC\";\r\n button.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n\r\n button.onIsCheckedChangedObservable.add(function (state) {\r\n func(state);\r\n });\r\n\r\n const _selector = Control.AddHeader(button, text, \"200px\", { isHorizontal: true, controlFirst: true });\r\n _selector.height = \"30px\";\r\n _selector.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n _selector.left = \"4px\";\r\n\r\n this.groupPanel.addControl(_selector);\r\n this.selectors.push(_selector);\r\n button.isChecked = checked;\r\n\r\n if (this.groupPanel.parent && this.groupPanel.parent.parent) {\r\n button.color = (<SelectionPanel>this.groupPanel.parent.parent).buttonColor;\r\n button.background = (<SelectionPanel>this.groupPanel.parent.parent).buttonBackground;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorLabel(selectorNb: number, label: string) {\r\n (<TextBlock>this.selectors[selectorNb].children[1]).text = label;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorLabelColor(selectorNb: number, color: string) {\r\n (<TextBlock>this.selectors[selectorNb].children[1]).color = color;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorButtonColor(selectorNb: number, color: string) {\r\n this.selectors[selectorNb].children[0].color = color;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorButtonBackground(selectorNb: number, color: string) {\r\n (<Checkbox>this.selectors[selectorNb].children[0]).background = color;\r\n }\r\n}\r\n\r\n/** Class used to create a RadioGroup\r\n * which contains groups of radio buttons\r\n */\r\nexport class RadioGroup extends SelectorGroup {\r\n private _selectNb = 0;\r\n\r\n /** Adds a radio button as a control\r\n * @param label is the label for the selector\r\n * @param func is the function called when the Selector is checked\r\n * @param checked is true when Selector is checked\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public addRadio(label: string, func = (n: number) => {}, checked = false): void {\r\n const nb = this._selectNb++;\r\n const button = new RadioButton();\r\n button.name = label;\r\n button.width = \"20px\";\r\n button.height = \"20px\";\r\n button.color = \"#364249\";\r\n button.background = \"#CCCCCC\";\r\n button.group = this.name;\r\n button.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n\r\n button.onIsCheckedChangedObservable.add(function (state) {\r\n if (state) {\r\n func(nb);\r\n }\r\n });\r\n\r\n const _selector = Control.AddHeader(button, label, \"200px\", { isHorizontal: true, controlFirst: true });\r\n _selector.height = \"30px\";\r\n _selector.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n _selector.left = \"4px\";\r\n this.groupPanel.addControl(_selector);\r\n this.selectors.push(_selector);\r\n button.isChecked = checked;\r\n\r\n if (this.groupPanel.parent && this.groupPanel.parent.parent) {\r\n button.color = (<SelectionPanel>this.groupPanel.parent.parent).buttonColor;\r\n button.background = (<SelectionPanel>this.groupPanel.parent.parent).buttonBackground;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorLabel(selectorNb: number, label: string) {\r\n (<TextBlock>this.selectors[selectorNb].children[1]).text = label;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorLabelColor(selectorNb: number, color: string) {\r\n (<TextBlock>this.selectors[selectorNb].children[1]).color = color;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorButtonColor(selectorNb: number, color: string) {\r\n this.selectors[selectorNb].children[0].color = color;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorButtonBackground(selectorNb: number, color: string) {\r\n (<RadioButton>this.selectors[selectorNb].children[0]).background = color;\r\n }\r\n}\r\n\r\n/** Class used to create a SliderGroup\r\n * which contains groups of slider buttons\r\n */\r\nexport class SliderGroup extends SelectorGroup {\r\n /**\r\n * Adds a slider to the SelectorGroup\r\n * @param label is the label for the SliderBar\r\n * @param func is the function called when the Slider moves\r\n * @param unit is a string describing the units used, eg degrees or metres\r\n * @param min is the minimum value for the Slider\r\n * @param max is the maximum value for the Slider\r\n * @param value is the start value for the Slider between min and max\r\n * @param onValueChange is the function used to format the value displayed, eg radians to degrees\r\n */\r\n public addSlider(\r\n label: string,\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n func = (v: number) => {},\r\n unit: string = \"Units\",\r\n min: number = 0,\r\n max: number = 0,\r\n value: number = 0,\r\n onValueChange = (v: number) => {\r\n return v | 0;\r\n }\r\n ): void {\r\n const button = new Slider();\r\n button.name = unit;\r\n button.value = value;\r\n button.minimum = min;\r\n button.maximum = max;\r\n button.width = 0.9;\r\n button.height = \"20px\";\r\n button.color = \"#364249\";\r\n button.background = \"#CCCCCC\";\r\n button.borderColor = \"black\";\r\n button.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n button.left = \"4px\";\r\n button.paddingBottom = \"4px\";\r\n\r\n button.onValueChangedObservable.add(function (value) {\r\n (<TextBlock>button.parent!.children[0]).text = button.parent!.children[0].name + \": \" + onValueChange(value) + \" \" + button.name;\r\n func(value);\r\n });\r\n\r\n const _selector = Control.AddHeader(button, label + \": \" + onValueChange(value) + \" \" + unit, \"30px\", { isHorizontal: false, controlFirst: false });\r\n _selector.height = \"60px\";\r\n _selector.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n _selector.left = \"4px\";\r\n _selector.children[0].name = label;\r\n this.groupPanel.addControl(_selector);\r\n this.selectors.push(_selector);\r\n\r\n if (this.groupPanel.parent && this.groupPanel.parent.parent) {\r\n button.color = (<SelectionPanel>this.groupPanel.parent.parent).buttonColor;\r\n button.background = (<SelectionPanel>this.groupPanel.parent.parent).buttonBackground;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorLabel(selectorNb: number, label: string) {\r\n this.selectors[selectorNb].children[0].name = label;\r\n (<TextBlock>this.selectors[selectorNb].children[0]).text =\r\n label + \": \" + (<Slider>this.selectors[selectorNb].children[1]).value + \" \" + this.selectors[selectorNb].children[1].name;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorLabelColor(selectorNb: number, color: string) {\r\n (<TextBlock>this.selectors[selectorNb].children[0]).color = color;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorButtonColor(selectorNb: number, color: string) {\r\n this.selectors[selectorNb].children[1].color = color;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorButtonBackground(selectorNb: number, color: string) {\r\n (<Slider>this.selectors[selectorNb].children[1]).background = color;\r\n }\r\n}\r\n\r\n/** Class used to hold the controls for the checkboxes, radio buttons and sliders\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/selector\r\n */\r\nexport class SelectionPanel extends Rectangle {\r\n private _panel: StackPanel;\r\n private _buttonColor: string = \"#364249\";\r\n private _buttonBackground: string = \"#CCCCCC\";\r\n private _headerColor: string = \"black\";\r\n private _barColor: string = \"white\";\r\n private _barHeight: string = \"2px\";\r\n private _spacerHeight: string = \"20px\";\r\n private _labelColor: string;\r\n private _groups: SelectorGroup[];\r\n private _bars: any[] = new Array();\r\n\r\n /**\r\n * Creates a new SelectionPanel\r\n * @param name of SelectionPanel\r\n * @param groups is an array of SelectionGroups\r\n */\r\n constructor(\r\n /** name of SelectionPanel */\r\n public override name: string,\r\n /** an array of SelectionGroups */\r\n public groups: SelectorGroup[] = []\r\n ) {\r\n super(name);\r\n this._groups = groups;\r\n this.thickness = 2;\r\n this._panel = new StackPanel();\r\n this._panel.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n this._panel.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n this._panel.top = 5;\r\n this._panel.left = 5;\r\n this._panel.width = 0.95;\r\n if (groups.length > 0) {\r\n for (let i = 0; i < groups.length - 1; i++) {\r\n this._panel.addControl(groups[i].groupPanel);\r\n this._addSpacer();\r\n }\r\n this._panel.addControl(groups[groups.length - 1].groupPanel);\r\n }\r\n this.addControl(this._panel);\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"SelectionPanel\";\r\n }\r\n\r\n /** Gets the (stack) panel of the SelectionPanel */\r\n public get panel(): StackPanel {\r\n return this._panel;\r\n }\r\n\r\n /** Gets or sets the headerColor */\r\n public get headerColor(): string {\r\n return this._headerColor;\r\n }\r\n\r\n public set headerColor(color: string) {\r\n if (this._headerColor === color) {\r\n return;\r\n }\r\n this._headerColor = color;\r\n this._setHeaderColor();\r\n }\r\n\r\n private _setHeaderColor() {\r\n for (let i = 0; i < this._groups.length; i++) {\r\n this._groups[i].groupPanel.children[0].color = this._headerColor;\r\n }\r\n }\r\n\r\n /** Gets or sets the button color */\r\n public get buttonColor(): string {\r\n return this._buttonColor;\r\n }\r\n\r\n public set buttonColor(color: string) {\r\n if (this._buttonColor === color) {\r\n return;\r\n }\r\n\r\n this._buttonColor = color;\r\n this._setbuttonColor();\r\n }\r\n\r\n private _setbuttonColor() {\r\n for (let i = 0; i < this._groups.length; i++) {\r\n for (let j = 0; j < this._groups[i].selectors.length; j++) {\r\n (<CheckboxGroup | RadioGroup | SliderGroup>this._groups[i])._setSelectorButtonColor(j, this._buttonColor);\r\n }\r\n }\r\n }\r\n\r\n /** Gets or sets the label color */\r\n public get labelColor(): string {\r\n return this._labelColor;\r\n }\r\n\r\n public set labelColor(color: string) {\r\n if (this._labelColor === color) {\r\n return;\r\n }\r\n this._labelColor = color;\r\n this._setLabelColor();\r\n }\r\n\r\n private _setLabelColor() {\r\n for (let i = 0; i < this._groups.length; i++) {\r\n for (let j = 0; j < this._groups[i].selectors.length; j++) {\r\n (<CheckboxGroup | RadioGroup | SliderGroup>this._groups[i])._setSelectorLabelColor(j, this._labelColor);\r\n }\r\n }\r\n }\r\n\r\n /** Gets or sets the button background */\r\n public get buttonBackground(): string {\r\n return this._buttonBackground;\r\n }\r\n\r\n public set buttonBackground(color: string) {\r\n if (this._buttonBackground === color) {\r\n return;\r\n }\r\n\r\n this._buttonBackground = color;\r\n this._setButtonBackground();\r\n }\r\n\r\n private _setButtonBackground() {\r\n for (let i = 0; i < this._groups.length; i++) {\r\n for (let j = 0; j < this._groups[i].selectors.length; j++) {\r\n (<CheckboxGroup | RadioGroup | SliderGroup>this._groups[i])._setSelectorButtonBackground(j, this._buttonBackground);\r\n }\r\n }\r\n }\r\n\r\n /** Gets or sets the color of separator bar */\r\n public get barColor(): string {\r\n return this._barColor;\r\n }\r\n\r\n public set barColor(color: string) {\r\n if (this._barColor === color) {\r\n return;\r\n }\r\n\r\n this._barColor = color;\r\n this._setBarColor();\r\n }\r\n\r\n private _setBarColor() {\r\n for (let i = 0; i < this._bars.length; i++) {\r\n this._bars[i].children[0].background = this._barColor;\r\n }\r\n }\r\n\r\n /** Gets or sets the height of separator bar */\r\n public get barHeight(): string {\r\n return this._barHeight;\r\n }\r\n\r\n public set barHeight(value: string) {\r\n if (this._barHeight === value) {\r\n return;\r\n }\r\n\r\n this._barHeight = value;\r\n this._setBarHeight();\r\n }\r\n\r\n private _setBarHeight() {\r\n for (let i = 0; i < this._bars.length; i++) {\r\n this._bars[i].children[0].height = this._barHeight;\r\n }\r\n }\r\n\r\n /** Gets or sets the height of spacers*/\r\n public get spacerHeight(): string {\r\n return this._spacerHeight;\r\n }\r\n\r\n public set spacerHeight(value: string) {\r\n if (this._spacerHeight === value) {\r\n return;\r\n }\r\n\r\n this._spacerHeight = value;\r\n this._setSpacerHeight();\r\n }\r\n\r\n private _setSpacerHeight() {\r\n for (let i = 0; i < this._bars.length; i++) {\r\n this._bars[i].height = this._spacerHeight;\r\n }\r\n }\r\n\r\n /** Adds a bar between groups */\r\n private _addSpacer(): void {\r\n const separator = new Container();\r\n separator.width = 1;\r\n separator.height = this._spacerHeight;\r\n separator.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n\r\n const bar = new Rectangle();\r\n bar.width = 1;\r\n bar.height = this._barHeight;\r\n bar.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n bar.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n bar.background = this._barColor;\r\n bar.color = \"transparent\";\r\n separator.addControl(bar);\r\n\r\n this._panel.addControl(separator);\r\n this._bars.push(separator);\r\n }\r\n\r\n /** Add a group to the selection panel\r\n * @param group is the selector group to add\r\n */\r\n public addGroup(group: SelectorGroup): void {\r\n if (this._groups.length > 0) {\r\n this._addSpacer();\r\n }\r\n this._panel.addControl(group.groupPanel);\r\n this._groups.push(group);\r\n group.groupPanel.children[0].color = this._headerColor;\r\n for (let j = 0; j < group.selectors.length; j++) {\r\n (<CheckboxGroup | RadioGroup | SliderGroup>group)._setSelectorButtonColor(j, this._buttonColor);\r\n (<CheckboxGroup | RadioGroup | SliderGroup>group)._setSelectorButtonBackground(j, this._buttonBackground);\r\n }\r\n }\r\n\r\n /** Remove the group from the given position\r\n * @param groupNb is the position of the group in the list\r\n */\r\n public removeGroup(groupNb: number): void {\r\n if (groupNb < 0 || groupNb >= this._groups.length) {\r\n return;\r\n }\r\n const group = this._groups[groupNb];\r\n this._panel.removeControl(group.groupPanel);\r\n this._groups.splice(groupNb, 1);\r\n if (groupNb < this._bars.length) {\r\n this._panel.removeControl(this._bars[groupNb]);\r\n this._bars.splice(groupNb, 1);\r\n }\r\n }\r\n\r\n /** Change a group header label\r\n * @param label is the new group header label\r\n * @param groupNb is the number of the group to relabel\r\n * */\r\n public setHeaderName(label: string, groupNb: number) {\r\n if (groupNb < 0 || groupNb >= this._groups.length) {\r\n return;\r\n }\r\n const group = this._groups[groupNb];\r\n (<TextBlock>group.groupPanel.children[0]).text = label;\r\n }\r\n\r\n /** Change selector label to the one given\r\n * @param label is the new selector label\r\n * @param groupNb is the number of the groupcontaining the selector\r\n * @param selectorNb is the number of the selector within a group to relabel\r\n * */\r\n public relabel(label: string, groupNb: number, selectorNb: number): void {\r\n if (groupNb < 0 || groupNb >= this._groups.length) {\r\n return;\r\n }\r\n const group = this._groups[groupNb];\r\n if (selectorNb < 0 || selectorNb >= group.selectors.length) {\r\n return;\r\n }\r\n (<CheckboxGroup | RadioGroup | SliderGroup>group)._setSelectorLabel(selectorNb, label);\r\n }\r\n\r\n /** For a given group position remove the selector at the given position\r\n * @param groupNb is the number of the group to remove the selector from\r\n * @param selectorNb is the number of the selector within the group\r\n */\r\n public removeFromGroupSelector(groupNb: number, selectorNb: number): void {\r\n if (groupNb < 0 || groupNb >= this._groups.length) {\r\n return;\r\n }\r\n const group = this._groups[groupNb];\r\n if (selectorNb < 0 || selectorNb >= group.selectors.length) {\r\n return;\r\n }\r\n group.removeSelector(selectorNb);\r\n }\r\n\r\n /** For a given group position of correct type add a checkbox button\r\n * @param groupNb is the number of the group to remove the selector from\r\n * @param label is the label for the selector\r\n * @param func is the function called when the Selector is checked\r\n * @param checked is true when Selector is checked\r\n */\r\n public addToGroupCheckbox(groupNb: number, label: string, func = () => {}, checked: boolean = false): void {\r\n if (groupNb < 0 || groupNb >= this._groups.length) {\r\n return;\r\n }\r\n const group = this._groups[groupNb];\r\n (<CheckboxGroup>group).addCheckbox(label, func, checked);\r\n }\r\n\r\n /** For a given group position of correct type add a radio button\r\n * @param groupNb is the number of the group to remove the selector from\r\n * @param label is the label for the selector\r\n * @param func is the function called when the Selector is checked\r\n * @param checked is true when Selector is checked\r\n */\r\n public addToGroupRadio(groupNb: number, label: string, func = () => {}, checked: boolean = false): void {\r\n if (groupNb < 0 || groupNb >= this._groups.length) {\r\n return;\r\n }\r\n const group = this._groups[groupNb];\r\n (<RadioGroup>group).addRadio(label, func, checked);\r\n }\r\n\r\n /**\r\n * For a given slider group add a slider\r\n * @param groupNb is the number of the group to add the slider to\r\n * @param label is the label for the Slider\r\n * @param func is the function called when the Slider moves\r\n * @param unit is a string describing the units used, eg degrees or metres\r\n * @param min is the minimum value for the Slider\r\n * @param max is the maximum value for the Slider\r\n * @param value is the start value for the Slider between min and max\r\n * @param onVal is the function used to format the value displayed, eg radians to degrees\r\n */\r\n public addToGroupSlider(\r\n groupNb: number,\r\n label: string,\r\n func = () => {},\r\n unit: string = \"Units\",\r\n min: number = 0,\r\n max: number = 0,\r\n value: number = 0,\r\n onVal = (v: number) => {\r\n return v | 0;\r\n }\r\n ): void {\r\n if (groupNb < 0 || groupNb >= this._groups.length) {\r\n return;\r\n }\r\n const group = this._groups[groupNb];\r\n (<SliderGroup>group).addSlider(label, func, unit, min, max, value, onVal);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"selector.js","sourceRoot":"","sources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B,CAAC,EACjB,QAAQ,CAAC,CAAS,EAAE,EAAE;QAClB,OAAO,CAAC,GAAG,CAAC,CAAC;IACjB,CAAC;QAED,IAAI,OAAO,GAAG,CAAC,IAAI,OAAO,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YAChD,OAAO;QACX,CAAC;QACD,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACtB,KAAM,CAAC,SAAS,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;IAC9E,CAAC;CACJ","sourcesContent":["import { Rectangle } from \"./rectangle\";\r\nimport { StackPanel } from \"./stackPanel\";\r\nimport { Control } from \"./control\";\r\nimport { TextBlock } from \"./textBlock\";\r\nimport { Checkbox } from \"./checkbox\";\r\nimport { RadioButton } from \"./radioButton\";\r\nimport { Slider } from \"./sliders/slider\";\r\nimport { Container } from \"./container\";\r\n\r\n/** Class used to create a RadioGroup\r\n * which contains groups of radio buttons\r\n */\r\nexport class SelectorGroup {\r\n private _groupPanel = new StackPanel();\r\n private _selectors: StackPanel[] = new Array();\r\n private _groupHeader: TextBlock;\r\n\r\n /**\r\n * Creates a new SelectorGroup\r\n * @param name of group, used as a group heading\r\n */\r\n constructor(\r\n /** name of SelectorGroup */\r\n public name: string\r\n ) {\r\n this._groupPanel.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n this._groupPanel.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n this._groupHeader = this._addGroupHeader(name);\r\n }\r\n\r\n /** Gets the groupPanel of the SelectorGroup */\r\n public get groupPanel(): StackPanel {\r\n return this._groupPanel;\r\n }\r\n\r\n /** Gets the selectors array */\r\n public get selectors(): StackPanel[] {\r\n return this._selectors;\r\n }\r\n\r\n /** Gets and sets the group header */\r\n public get header() {\r\n return this._groupHeader.text;\r\n }\r\n\r\n public set header(label: string) {\r\n if (this._groupHeader.text === \"label\") {\r\n return;\r\n }\r\n\r\n this._groupHeader.text = label;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n private _addGroupHeader(text: string): TextBlock {\r\n const groupHeading = new TextBlock(\"groupHead\", text);\r\n groupHeading.width = 0.9;\r\n groupHeading.height = \"30px\";\r\n groupHeading.textWrapping = true;\r\n groupHeading.color = \"black\";\r\n groupHeading.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n groupHeading.textHorizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n groupHeading.left = \"2px\";\r\n this._groupPanel.addControl(groupHeading);\r\n return groupHeading;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _getSelector(selectorNb: number) {\r\n if (selectorNb < 0 || selectorNb >= this._selectors.length) {\r\n return;\r\n }\r\n return this._selectors[selectorNb];\r\n }\r\n\r\n /** Removes the selector at the given position\r\n * @param selectorNb the position of the selector within the group\r\n */\r\n public removeSelector(selectorNb: number) {\r\n if (selectorNb < 0 || selectorNb >= this._selectors.length) {\r\n return;\r\n }\r\n this._groupPanel.removeControl(this._selectors[selectorNb]);\r\n this._selectors.splice(selectorNb, 1);\r\n }\r\n}\r\n\r\n/** Class used to create a CheckboxGroup\r\n * which contains groups of checkbox buttons\r\n */\r\nexport class CheckboxGroup extends SelectorGroup {\r\n /** Adds a checkbox as a control\r\n * @param text is the label for the selector\r\n * @param func is the function called when the Selector is checked\r\n * @param checked is true when Selector is checked\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public addCheckbox(text: string, func = (s: boolean) => {}, checked: boolean = false): void {\r\n checked = checked || false;\r\n const button = new Checkbox();\r\n button.width = \"20px\";\r\n button.height = \"20px\";\r\n button.color = \"#364249\";\r\n button.background = \"#CCCCCC\";\r\n button.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n\r\n button.onIsCheckedChangedObservable.add(function (state) {\r\n func(state);\r\n });\r\n\r\n const _selector = Control.AddHeader(button, text, \"200px\", { isHorizontal: true, controlFirst: true });\r\n _selector.height = \"30px\";\r\n _selector.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n _selector.left = \"4px\";\r\n\r\n this.groupPanel.addControl(_selector);\r\n this.selectors.push(_selector);\r\n button.isChecked = checked;\r\n\r\n if (this.groupPanel.parent && this.groupPanel.parent.parent) {\r\n button.color = (<SelectionPanel>this.groupPanel.parent.parent).buttonColor;\r\n button.background = (<SelectionPanel>this.groupPanel.parent.parent).buttonBackground;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorLabel(selectorNb: number, label: string) {\r\n (<TextBlock>this.selectors[selectorNb].children[1]).text = label;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorLabelColor(selectorNb: number, color: string) {\r\n (<TextBlock>this.selectors[selectorNb].children[1]).color = color;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorButtonColor(selectorNb: number, color: string) {\r\n this.selectors[selectorNb].children[0].color = color;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorButtonBackground(selectorNb: number, color: string) {\r\n (<Checkbox>this.selectors[selectorNb].children[0]).background = color;\r\n }\r\n}\r\n\r\n/** Class used to create a RadioGroup\r\n * which contains groups of radio buttons\r\n */\r\nexport class RadioGroup extends SelectorGroup {\r\n private _selectNb = 0;\r\n\r\n /** Adds a radio button as a control\r\n * @param label is the label for the selector\r\n * @param func is the function called when the Selector is checked\r\n * @param checked is true when Selector is checked\r\n */\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n public addRadio(label: string, func = (n: number) => {}, checked = false): void {\r\n const nb = this._selectNb++;\r\n const button = new RadioButton();\r\n button.name = label;\r\n button.width = \"20px\";\r\n button.height = \"20px\";\r\n button.color = \"#364249\";\r\n button.background = \"#CCCCCC\";\r\n button.group = this.name;\r\n button.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n\r\n button.onIsCheckedChangedObservable.add(function (state) {\r\n if (state) {\r\n func(nb);\r\n }\r\n });\r\n\r\n const _selector = Control.AddHeader(button, label, \"200px\", { isHorizontal: true, controlFirst: true });\r\n _selector.height = \"30px\";\r\n _selector.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n _selector.left = \"4px\";\r\n this.groupPanel.addControl(_selector);\r\n this.selectors.push(_selector);\r\n button.isChecked = checked;\r\n\r\n if (this.groupPanel.parent && this.groupPanel.parent.parent) {\r\n button.color = (<SelectionPanel>this.groupPanel.parent.parent).buttonColor;\r\n button.background = (<SelectionPanel>this.groupPanel.parent.parent).buttonBackground;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorLabel(selectorNb: number, label: string) {\r\n (<TextBlock>this.selectors[selectorNb].children[1]).text = label;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorLabelColor(selectorNb: number, color: string) {\r\n (<TextBlock>this.selectors[selectorNb].children[1]).color = color;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorButtonColor(selectorNb: number, color: string) {\r\n this.selectors[selectorNb].children[0].color = color;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorButtonBackground(selectorNb: number, color: string) {\r\n (<RadioButton>this.selectors[selectorNb].children[0]).background = color;\r\n }\r\n}\r\n\r\n/** Class used to create a SliderGroup\r\n * which contains groups of slider buttons\r\n */\r\nexport class SliderGroup extends SelectorGroup {\r\n /**\r\n * Adds a slider to the SelectorGroup\r\n * @param label is the label for the SliderBar\r\n * @param func is the function called when the Slider moves\r\n * @param unit is a string describing the units used, eg degrees or metres\r\n * @param min is the minimum value for the Slider\r\n * @param max is the maximum value for the Slider\r\n * @param value is the start value for the Slider between min and max\r\n * @param onValueChange is the function used to format the value displayed, eg radians to degrees\r\n */\r\n public addSlider(\r\n label: string,\r\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n func = (v: number) => {},\r\n unit: string = \"Units\",\r\n min: number = 0,\r\n max: number = 0,\r\n value: number = 0,\r\n onValueChange = (v: number) => {\r\n return v | 0;\r\n }\r\n ): void {\r\n const button = new Slider();\r\n button.name = unit;\r\n button.value = value;\r\n button.minimum = min;\r\n button.maximum = max;\r\n button.width = 0.9;\r\n button.height = \"20px\";\r\n button.color = \"#364249\";\r\n button.background = \"#CCCCCC\";\r\n button.borderColor = \"black\";\r\n button.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n button.left = \"4px\";\r\n button.paddingBottom = \"4px\";\r\n\r\n button.onValueChangedObservable.add(function (value) {\r\n (<TextBlock>button.parent!.children[0]).text = button.parent!.children[0].name + \": \" + onValueChange(value) + \" \" + button.name;\r\n func(value);\r\n });\r\n\r\n const _selector = Control.AddHeader(button, label + \": \" + onValueChange(value) + \" \" + unit, \"30px\", { isHorizontal: false, controlFirst: false });\r\n _selector.height = \"60px\";\r\n _selector.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n _selector.left = \"4px\";\r\n _selector.children[0].name = label;\r\n this.groupPanel.addControl(_selector);\r\n this.selectors.push(_selector);\r\n\r\n if (this.groupPanel.parent && this.groupPanel.parent.parent) {\r\n button.color = (<SelectionPanel>this.groupPanel.parent.parent).buttonColor;\r\n button.background = (<SelectionPanel>this.groupPanel.parent.parent).buttonBackground;\r\n }\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorLabel(selectorNb: number, label: string) {\r\n this.selectors[selectorNb].children[0].name = label;\r\n (<TextBlock>this.selectors[selectorNb].children[0]).text =\r\n label + \": \" + (<Slider>this.selectors[selectorNb].children[1]).value + \" \" + this.selectors[selectorNb].children[1].name;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorLabelColor(selectorNb: number, color: string) {\r\n (<TextBlock>this.selectors[selectorNb].children[0]).color = color;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorButtonColor(selectorNb: number, color: string) {\r\n this.selectors[selectorNb].children[1].color = color;\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n public _setSelectorButtonBackground(selectorNb: number, color: string) {\r\n (<Slider>this.selectors[selectorNb].children[1]).background = color;\r\n }\r\n}\r\n\r\n/** Class used to hold the controls for the checkboxes, radio buttons and sliders\r\n * @see https://doc.babylonjs.com/features/featuresDeepDive/gui/selector\r\n */\r\nexport class SelectionPanel extends Rectangle {\r\n private _panel: StackPanel;\r\n private _buttonColor: string = \"#364249\";\r\n private _buttonBackground: string = \"#CCCCCC\";\r\n private _headerColor: string = \"black\";\r\n private _barColor: string = \"white\";\r\n private _barHeight: string = \"2px\";\r\n private _spacerHeight: string = \"20px\";\r\n private _labelColor: string;\r\n private _groups: SelectorGroup[];\r\n private _bars: any[] = new Array();\r\n\r\n /**\r\n * Creates a new SelectionPanel\r\n * @param name of SelectionPanel\r\n * @param groups is an array of SelectionGroups\r\n */\r\n constructor(\r\n /** name of SelectionPanel */\r\n public override name: string,\r\n /** an array of SelectionGroups */\r\n public groups: SelectorGroup[] = []\r\n ) {\r\n super(name);\r\n this._groups = groups;\r\n this.thickness = 2;\r\n this._panel = new StackPanel();\r\n this._panel.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n this._panel.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n this._panel.top = 5;\r\n this._panel.left = 5;\r\n this._panel.width = 0.95;\r\n if (groups.length > 0) {\r\n for (let i = 0; i < groups.length - 1; i++) {\r\n this._panel.addControl(groups[i].groupPanel);\r\n this._addSpacer();\r\n }\r\n this._panel.addControl(groups[groups.length - 1].groupPanel);\r\n }\r\n this.addControl(this._panel);\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"SelectionPanel\";\r\n }\r\n\r\n /** Gets the (stack) panel of the SelectionPanel */\r\n public get panel(): StackPanel {\r\n return this._panel;\r\n }\r\n\r\n /** Gets or sets the headerColor */\r\n public get headerColor(): string {\r\n return this._headerColor;\r\n }\r\n\r\n public set headerColor(color: string) {\r\n if (this._headerColor === color) {\r\n return;\r\n }\r\n this._headerColor = color;\r\n this._setHeaderColor();\r\n }\r\n\r\n private _setHeaderColor() {\r\n for (let i = 0; i < this._groups.length; i++) {\r\n this._groups[i].groupPanel.children[0].color = this._headerColor;\r\n }\r\n }\r\n\r\n /** Gets or sets the button color */\r\n public get buttonColor(): string {\r\n return this._buttonColor;\r\n }\r\n\r\n public set buttonColor(color: string) {\r\n if (this._buttonColor === color) {\r\n return;\r\n }\r\n\r\n this._buttonColor = color;\r\n this._setbuttonColor();\r\n }\r\n\r\n private _setbuttonColor() {\r\n for (let i = 0; i < this._groups.length; i++) {\r\n for (let j = 0; j < this._groups[i].selectors.length; j++) {\r\n (<CheckboxGroup | RadioGroup | SliderGroup>this._groups[i])._setSelectorButtonColor(j, this._buttonColor);\r\n }\r\n }\r\n }\r\n\r\n /** Gets or sets the label color */\r\n public get labelColor(): string {\r\n return this._labelColor;\r\n }\r\n\r\n public set labelColor(color: string) {\r\n if (this._labelColor === color) {\r\n return;\r\n }\r\n this._labelColor = color;\r\n this._setLabelColor();\r\n }\r\n\r\n private _setLabelColor() {\r\n for (let i = 0; i < this._groups.length; i++) {\r\n for (let j = 0; j < this._groups[i].selectors.length; j++) {\r\n (<CheckboxGroup | RadioGroup | SliderGroup>this._groups[i])._setSelectorLabelColor(j, this._labelColor);\r\n }\r\n }\r\n }\r\n\r\n /** Gets or sets the button background */\r\n public get buttonBackground(): string {\r\n return this._buttonBackground;\r\n }\r\n\r\n public set buttonBackground(color: string) {\r\n if (this._buttonBackground === color) {\r\n return;\r\n }\r\n\r\n this._buttonBackground = color;\r\n this._setButtonBackground();\r\n }\r\n\r\n private _setButtonBackground() {\r\n for (let i = 0; i < this._groups.length; i++) {\r\n for (let j = 0; j < this._groups[i].selectors.length; j++) {\r\n (<CheckboxGroup | RadioGroup | SliderGroup>this._groups[i])._setSelectorButtonBackground(j, this._buttonBackground);\r\n }\r\n }\r\n }\r\n\r\n /** Gets or sets the color of separator bar */\r\n public get barColor(): string {\r\n return this._barColor;\r\n }\r\n\r\n public set barColor(color: string) {\r\n if (this._barColor === color) {\r\n return;\r\n }\r\n\r\n this._barColor = color;\r\n this._setBarColor();\r\n }\r\n\r\n private _setBarColor() {\r\n for (let i = 0; i < this._bars.length; i++) {\r\n this._bars[i].children[0].background = this._barColor;\r\n }\r\n }\r\n\r\n /** Gets or sets the height of separator bar */\r\n public get barHeight(): string {\r\n return this._barHeight;\r\n }\r\n\r\n public set barHeight(value: string) {\r\n if (this._barHeight === value) {\r\n return;\r\n }\r\n\r\n this._barHeight = value;\r\n this._setBarHeight();\r\n }\r\n\r\n private _setBarHeight() {\r\n for (let i = 0; i < this._bars.length; i++) {\r\n this._bars[i].children[0].height = this._barHeight;\r\n }\r\n }\r\n\r\n /** Gets or sets the height of spacers*/\r\n public get spacerHeight(): string {\r\n return this._spacerHeight;\r\n }\r\n\r\n public set spacerHeight(value: string) {\r\n if (this._spacerHeight === value) {\r\n return;\r\n }\r\n\r\n this._spacerHeight = value;\r\n this._setSpacerHeight();\r\n }\r\n\r\n private _setSpacerHeight() {\r\n for (let i = 0; i < this._bars.length; i++) {\r\n this._bars[i].height = this._spacerHeight;\r\n }\r\n }\r\n\r\n /** Adds a bar between groups */\r\n private _addSpacer(): void {\r\n const separator = new Container();\r\n separator.width = 1;\r\n separator.height = this._spacerHeight;\r\n separator.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n\r\n const bar = new Rectangle();\r\n bar.width = 1;\r\n bar.height = this._barHeight;\r\n bar.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n bar.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n bar.background = this._barColor;\r\n bar.color = \"transparent\";\r\n separator.addControl(bar);\r\n\r\n this._panel.addControl(separator);\r\n this._bars.push(separator);\r\n }\r\n\r\n /** Add a group to the selection panel\r\n * @param group is the selector group to add\r\n */\r\n public addGroup(group: SelectorGroup): void {\r\n if (this._groups.length > 0) {\r\n this._addSpacer();\r\n }\r\n this._panel.addControl(group.groupPanel);\r\n this._groups.push(group);\r\n group.groupPanel.children[0].color = this._headerColor;\r\n for (let j = 0; j < group.selectors.length; j++) {\r\n (<CheckboxGroup | RadioGroup | SliderGroup>group)._setSelectorButtonColor(j, this._buttonColor);\r\n (<CheckboxGroup | RadioGroup | SliderGroup>group)._setSelectorButtonBackground(j, this._buttonBackground);\r\n }\r\n }\r\n\r\n /** Remove the group from the given position\r\n * @param groupNb is the position of the group in the list\r\n */\r\n public removeGroup(groupNb: number): void {\r\n if (groupNb < 0 || groupNb >= this._groups.length) {\r\n return;\r\n }\r\n const group = this._groups[groupNb];\r\n this._panel.removeControl(group.groupPanel);\r\n this._groups.splice(groupNb, 1);\r\n if (groupNb < this._bars.length) {\r\n this._panel.removeControl(this._bars[groupNb]);\r\n this._bars.splice(groupNb, 1);\r\n }\r\n }\r\n\r\n /** Change a group header label\r\n * @param label is the new group header label\r\n * @param groupNb is the number of the group to relabel\r\n * */\r\n public setHeaderName(label: string, groupNb: number) {\r\n if (groupNb < 0 || groupNb >= this._groups.length) {\r\n return;\r\n }\r\n const group = this._groups[groupNb];\r\n (<TextBlock>group.groupPanel.children[0]).text = label;\r\n }\r\n\r\n /** Change selector label to the one given\r\n * @param label is the new selector label\r\n * @param groupNb is the number of the groupcontaining the selector\r\n * @param selectorNb is the number of the selector within a group to relabel\r\n * */\r\n public relabel(label: string, groupNb: number, selectorNb: number): void {\r\n if (groupNb < 0 || groupNb >= this._groups.length) {\r\n return;\r\n }\r\n const group = this._groups[groupNb];\r\n if (selectorNb < 0 || selectorNb >= group.selectors.length) {\r\n return;\r\n }\r\n (<CheckboxGroup | RadioGroup | SliderGroup>group)._setSelectorLabel(selectorNb, label);\r\n }\r\n\r\n /** For a given group position remove the selector at the given position\r\n * @param groupNb is the number of the group to remove the selector from\r\n * @param selectorNb is the number of the selector within the group\r\n */\r\n public removeFromGroupSelector(groupNb: number, selectorNb: number): void {\r\n if (groupNb < 0 || groupNb >= this._groups.length) {\r\n return;\r\n }\r\n const group = this._groups[groupNb];\r\n if (selectorNb < 0 || selectorNb >= group.selectors.length) {\r\n return;\r\n }\r\n group.removeSelector(selectorNb);\r\n }\r\n\r\n /** For a given group position of correct type add a checkbox button\r\n * @param groupNb is the number of the group to remove the selector from\r\n * @param label is the label for the selector\r\n * @param func is the function called when the Selector is checked\r\n * @param checked is true when Selector is checked\r\n */\r\n public addToGroupCheckbox(groupNb: number, label: string, func = () => {}, checked: boolean = false): void {\r\n if (groupNb < 0 || groupNb >= this._groups.length) {\r\n return;\r\n }\r\n const group = this._groups[groupNb];\r\n (<CheckboxGroup>group).addCheckbox(label, func, checked);\r\n }\r\n\r\n /** For a given group position of correct type add a radio button\r\n * @param groupNb is the number of the group to remove the selector from\r\n * @param label is the label for the selector\r\n * @param func is the function called when the Selector is checked\r\n * @param checked is true when Selector is checked\r\n */\r\n public addToGroupRadio(groupNb: number, label: string, func = () => {}, checked: boolean = false): void {\r\n if (groupNb < 0 || groupNb >= this._groups.length) {\r\n return;\r\n }\r\n const group = this._groups[groupNb];\r\n (<RadioGroup>group).addRadio(label, func, checked);\r\n }\r\n\r\n /**\r\n * For a given slider group add a slider\r\n * @param groupNb is the number of the group to add the slider to\r\n * @param label is the label for the Slider\r\n * @param func is the function called when the Slider moves\r\n * @param unit is a string describing the units used, eg degrees or metres\r\n * @param min is the minimum value for the Slider\r\n * @param max is the maximum value for the Slider\r\n * @param value is the start value for the Slider between min and max\r\n * @param onVal is the function used to format the value displayed, eg radians to degrees\r\n */\r\n public addToGroupSlider(\r\n groupNb: number,\r\n label: string,\r\n func = () => {},\r\n unit: string = \"Units\",\r\n min: number = 0,\r\n max: number = 0,\r\n value: number = 0,\r\n onVal = (v: number) => {\r\n return v | 0;\r\n }\r\n ): void {\r\n if (groupNb < 0 || groupNb >= this._groups.length) {\r\n return;\r\n }\r\n const group = this._groups[groupNb];\r\n (<SliderGroup>group).addSlider(label, func, unit, min, max, value, onVal);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"baseSlider.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/2D/controls/sliders/baseSlider.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAGlD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,2CAA6B;AACjD,OAAO,EAAE,MAAM,EAAE,uCAAyB;AAE1C;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,OAAO;IA0BnC,sEAAsE;IAEtE,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED,IAAW,YAAY,CAAC,KAAc;QAClC,IAAI,IAAI,CAAC,aAAa,KAAK,KAAK,EAAE;YAC9B,OAAO;SACV;QAED,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAED,4DAA4D;IAE5D,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,IAAW,IAAI,CAAC,KAAa;QACzB,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,EAAE;YACtB,OAAO;SACV;QAED,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAED,6EAA6E;IAE7E,IAAW,SAAS;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChD,CAAC;IAED,oCAAoC;IACpC,IAAW,iBAAiB;QACxB,OAAO,IAAI,CAAC,UAAU,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,o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AAc,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;YACzC,IAAI,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;SAC9D;QAED,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,EAAE,CAAC,CAAC;IAC7D,CAAC;IAEe,YAAY,CAAC,MAAe,EAAE,WAAoB,EAAE,SAAiB,EAAE,WAAmB,EAAE,WAAoB;QAC5H,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAE5B,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAC/C,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IACjF,CAAC;IAEe,aAAa;QACzB,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,KAAK,CAAC,aAAa,EAAE,CAAC;IAC1B,CAAC;CACJ;AA/SG;IADC,SAAS,EAAE;8CAGX;AAaD;IADC,SAAS,EAAE;sCAGX;AAaD;IADC,SAAS,EAAE;2CAGX;AAmBD;IADC,SAAS,EAAE;4CAGX;AAmBD;IADC,SAAS,EAAE;yCAGX;AAeD;IADC,SAAS,EAAE;yCAGX;AAeD;IADC,SAAS,EAAE;uCAGX;AAgBD;IADC,SAAS,EAAE;4CAGX;AAaD;IADC,SAAS,EAAE;gDAGX","sourcesContent":["import { Observable } from \"core/Misc/observable\";\r\nimport type { Vector2 } from \"core/Maths/math.vector\";\r\n\r\nimport { Control } from \"../control\";\r\nimport { ValueAndUnit } from \"../../valueAndUnit\";\r\nimport type { PointerInfoBase } from \"core/Events/pointerEvents\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport { Logger } from \"core/Misc/logger\";\r\n\r\n/**\r\n * Class used to create slider controls\r\n */\r\nexport class BaseSlider extends Control {\r\n protected _thumbWidth = new ValueAndUnit(20, ValueAndUnit.UNITMODE_PIXEL, false);\r\n private _minimum = 0;\r\n private _maximum = 100;\r\n private _value = 50;\r\n private _isVertical = false;\r\n protected _barOffset = new ValueAndUnit(5, ValueAndUnit.UNITMODE_PIXEL, false);\r\n private _isThumbClamped = false;\r\n protected _displayThumb = true;\r\n private _step = 0;\r\n\r\n private _lastPointerDownId = -1;\r\n\r\n // Shared rendering info\r\n protected _effectiveBarOffset = 0;\r\n protected _renderLeft: number;\r\n protected _renderTop: number;\r\n protected _renderWidth: number;\r\n protected _renderHeight: number;\r\n protected _backgroundBoxLength: number;\r\n protected _backgroundBoxThickness: number;\r\n protected _effectiveThumbThickness: number;\r\n\r\n /** Observable raised when the slider value changes */\r\n public onValueChangedObservable = new Observable<number>();\r\n\r\n /** Gets or sets a boolean indicating if the thumb must be rendered */\r\n @serialize()\r\n public get displayThumb(): boolean {\r\n return this._displayThumb;\r\n }\r\n\r\n public set displayThumb(value: boolean) {\r\n if (this._displayThumb === value) {\r\n return;\r\n }\r\n\r\n this._displayThumb = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets a step to apply to values (0 by default) */\r\n @serialize()\r\n public get step(): number {\r\n return this._step;\r\n }\r\n\r\n public set step(value: number) {\r\n if (this._step === value) {\r\n return;\r\n }\r\n\r\n this._step = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets main bar offset (ie. the margin applied to the value bar) */\r\n @serialize()\r\n public get barOffset(): string | number {\r\n return this._barOffset.toString(this._host);\r\n }\r\n\r\n /** Gets main bar offset in pixels*/\r\n public get barOffsetInPixels(): number {\r\n return this._barOffset.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n }\r\n\r\n public set barOffset(value: string | number) {\r\n if (this._barOffset.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._barOffset.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /** Gets or sets thumb width */\r\n @serialize()\r\n public get thumbWidth(): string | number {\r\n return this._thumbWidth.toString(this._host);\r\n }\r\n\r\n /** Gets thumb width in pixels */\r\n public get thumbWidthInPixels(): number {\r\n return this._thumbWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n }\r\n\r\n public set thumbWidth(value: string | number) {\r\n if (this._thumbWidth.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._thumbWidth.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /** Gets or sets minimum value */\r\n @serialize()\r\n public get minimum(): number {\r\n return this._minimum;\r\n }\r\n\r\n public set minimum(value: number) {\r\n if (this._minimum === value) {\r\n return;\r\n }\r\n\r\n this._minimum = value;\r\n this._markAsDirty();\r\n\r\n this.value = Math.max(Math.min(this.value, this._maximum), this._minimum);\r\n }\r\n\r\n /** Gets or sets maximum value */\r\n @serialize()\r\n public get maximum(): number {\r\n return this._maximum;\r\n }\r\n\r\n public set maximum(value: number) {\r\n if (this._maximum === value) {\r\n return;\r\n }\r\n\r\n this._maximum = value;\r\n this._markAsDirty();\r\n\r\n this.value = Math.max(Math.min(this.value, this._maximum), this._minimum);\r\n }\r\n\r\n /** Gets or sets current value */\r\n @serialize()\r\n public get value(): number {\r\n return this._value;\r\n }\r\n\r\n public set value(value: number) {\r\n value = Math.max(Math.min(value, this._maximum), this._minimum);\r\n\r\n if (this._value === value) {\r\n return;\r\n }\r\n\r\n this._value = value;\r\n this._markAsDirty();\r\n this.onValueChangedObservable.notifyObservers(this._value);\r\n }\r\n\r\n /**Gets or sets a boolean indicating if the slider should be vertical or horizontal */\r\n @serialize()\r\n public get isVertical(): boolean {\r\n return this._isVertical;\r\n }\r\n\r\n public set isVertical(value: boolean) {\r\n if (this._isVertical === value) {\r\n return;\r\n }\r\n\r\n this._isVertical = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets a value indicating if the thumb can go over main bar extends */\r\n @serialize()\r\n public get isThumbClamped(): boolean {\r\n return this._isThumbClamped;\r\n }\r\n\r\n public set isThumbClamped(value: boolean) {\r\n if (this._isThumbClamped === value) {\r\n return;\r\n }\r\n\r\n this._isThumbClamped = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Creates a new BaseSlider\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 this.isPointerBlocker = true;\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"BaseSlider\";\r\n }\r\n\r\n protected _getThumbPosition() {\r\n if (this.isVertical) {\r\n return ((this.maximum - this.value) / (this.maximum - this.minimum)) * this._backgroundBoxLength;\r\n }\r\n\r\n return ((this.value - this.minimum) / (this.maximum - this.minimum)) * this._backgroundBoxLength;\r\n }\r\n\r\n protected _getThumbThickness(type: string): number {\r\n let thumbThickness = 0;\r\n switch (type) {\r\n case \"circle\":\r\n if (this._thumbWidth.isPixel) {\r\n thumbThickness = Math.max(this._thumbWidth.getValue(this._host), this._backgroundBoxThickness);\r\n } else {\r\n thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host);\r\n }\r\n break;\r\n case \"rectangle\":\r\n if (this._thumbWidth.isPixel) {\r\n thumbThickness = Math.min(this._thumbWidth.getValue(this._host), this._backgroundBoxThickness);\r\n } else {\r\n thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host);\r\n }\r\n }\r\n return thumbThickness;\r\n }\r\n\r\n protected _prepareRenderingData(type: string) {\r\n // Main bar\r\n this._effectiveBarOffset = 0;\r\n this._renderLeft = this._currentMeasure.left;\r\n this._renderTop = this._currentMeasure.top;\r\n this._renderWidth = this._currentMeasure.width;\r\n this._renderHeight = this._currentMeasure.height;\r\n\r\n this._backgroundBoxLength = Math.max(this._currentMeasure.width, this._currentMeasure.height);\r\n this._backgroundBoxThickness = Math.min(this._currentMeasure.width, this._currentMeasure.height);\r\n this._effectiveThumbThickness = this._getThumbThickness(type);\r\n\r\n if (this.displayThumb) {\r\n this._backgroundBoxLength -= this._effectiveThumbThickness;\r\n }\r\n //throw error when height is less than width for vertical slider\r\n if (this.isVertical && this._currentMeasure.height < this._currentMeasure.width) {\r\n Logger.Error(\"Height should be greater than width\");\r\n return;\r\n }\r\n if (this._barOffset.isPixel) {\r\n this._effectiveBarOffset = Math.min(this._barOffset.getValue(this._host), this._backgroundBoxThickness);\r\n } else {\r\n this._effectiveBarOffset = this._backgroundBoxThickness * this._barOffset.getValue(this._host);\r\n }\r\n\r\n this._backgroundBoxThickness -= this._effectiveBarOffset * 2;\r\n\r\n if (this.isVertical) {\r\n this._renderLeft += this._effectiveBarOffset;\r\n if (!this.isThumbClamped && this.displayThumb) {\r\n this._renderTop += this._effectiveThumbThickness / 2;\r\n }\r\n\r\n this._renderHeight = this._backgroundBoxLength;\r\n this._renderWidth = this._backgroundBoxThickness;\r\n } else {\r\n this._renderTop += this._effectiveBarOffset;\r\n if (!this.isThumbClamped && this.displayThumb) {\r\n this._renderLeft += this._effectiveThumbThickness / 2;\r\n }\r\n this._renderHeight = this._backgroundBoxThickness;\r\n this._renderWidth = this._backgroundBoxLength;\r\n }\r\n }\r\n\r\n // Events\r\n private _pointerIsDown = false;\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _updateValueFromPointer(x: number, y: number): void {\r\n if (this.rotation != 0) {\r\n this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition);\r\n x = this._transformedPosition.x;\r\n y = this._transformedPosition.y;\r\n }\r\n\r\n let value: number;\r\n if (this._isVertical) {\r\n value = this._minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this._maximum - this._minimum);\r\n } else {\r\n value = this._minimum + ((x - this._currentMeasure.left) / this._currentMeasure.width) * (this._maximum - this._minimum);\r\n }\r\n this.value = this._step ? Math.round(value / this._step) * this._step : value;\r\n }\r\n\r\n public override _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean {\r\n if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) {\r\n return false;\r\n }\r\n\r\n if (this.isReadOnly) {\r\n return true;\r\n }\r\n\r\n this._pointerIsDown = true;\r\n\r\n this._updateValueFromPointer(coordinates.x, coordinates.y);\r\n this._host._capturingControl[pointerId] = this;\r\n this._lastPointerDownId = pointerId;\r\n return true;\r\n }\r\n\r\n public override _onPointerMove(target: Control, coordinates: Vector2, pointerId: number, pi: PointerInfoBase): void {\r\n // Only listen to pointer move events coming from the last pointer to click on the element (To support dual vr controller interaction)\r\n if (pointerId != this._lastPointerDownId) {\r\n return;\r\n }\r\n\r\n if (this._pointerIsDown && !this.isReadOnly) {\r\n this._updateValueFromPointer(coordinates.x, coordinates.y);\r\n }\r\n\r\n super._onPointerMove(target, coordinates, pointerId, pi);\r\n }\r\n\r\n public override _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void {\r\n this._pointerIsDown = false;\r\n\r\n delete this._host._capturingControl[pointerId];\r\n super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick);\r\n }\r\n\r\n public override _onCanvasBlur(): void {\r\n this._forcePointerUp();\r\n super._onCanvasBlur();\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"baseSlider.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/2D/controls/sliders/baseSlider.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAGlD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,SAAS,EAAE,2CAA6B;AACjD,OAAO,EAAE,MAAM,EAAE,uCAAyB;AAE1C;;GAEG;AACH,MAAM,OAAO,UAAW,SAAQ,OAAO;IA0BnC,sEAAsE;IAEtE,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,aAAa,CAAC;IAC9B,CAAC;IAED,IAAW,YAAY,CAAC,KAAc;QAClC,IAAI,IAAI,CAAC,aAAa,KAAK,KAAK,EAAE,CAAC;YAC/B,OAAO;QACX,CAAC;QAED,IAA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AAE,WAAoB,EAAE,SAAiB,EAAE,WAAmB,EAAE,WAAoB;QAC5H,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAE5B,OAAO,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC;QAC/C,KAAK,CAAC,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;IACjF,CAAC;IAEe,aAAa;QACzB,IAAI,CAAC,eAAe,EAAE,CAAC;QACvB,KAAK,CAAC,aAAa,EAAE,CAAC;IAC1B,CAAC;CACJ;AA/SG;IADC,SAAS,EAAE;8CAGX;AAaD;IADC,SAAS,EAAE;sCAGX;AAaD;IADC,SAAS,EAAE;2CAGX;AAmBD;IADC,SAAS,EAAE;4CAGX;AAmBD;IADC,SAAS,EAAE;yCAGX;AAeD;IADC,SAAS,EAAE;yCAGX;AAeD;IADC,SAAS,EAAE;uCAGX;AAgBD;IADC,SAAS,EAAE;4CAGX;AAaD;IADC,SAAS,EAAE;gDAGX","sourcesContent":["import { Observable } from \"core/Misc/observable\";\r\nimport type { Vector2 } from \"core/Maths/math.vector\";\r\n\r\nimport { Control } from \"../control\";\r\nimport { ValueAndUnit } from \"../../valueAndUnit\";\r\nimport type { PointerInfoBase } from \"core/Events/pointerEvents\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport { Logger } from \"core/Misc/logger\";\r\n\r\n/**\r\n * Class used to create slider controls\r\n */\r\nexport class BaseSlider extends Control {\r\n protected _thumbWidth = new ValueAndUnit(20, ValueAndUnit.UNITMODE_PIXEL, false);\r\n private _minimum = 0;\r\n private _maximum = 100;\r\n private _value = 50;\r\n private _isVertical = false;\r\n protected _barOffset = new ValueAndUnit(5, ValueAndUnit.UNITMODE_PIXEL, false);\r\n private _isThumbClamped = false;\r\n protected _displayThumb = true;\r\n private _step = 0;\r\n\r\n private _lastPointerDownId = -1;\r\n\r\n // Shared rendering info\r\n protected _effectiveBarOffset = 0;\r\n protected _renderLeft: number;\r\n protected _renderTop: number;\r\n protected _renderWidth: number;\r\n protected _renderHeight: number;\r\n protected _backgroundBoxLength: number;\r\n protected _backgroundBoxThickness: number;\r\n protected _effectiveThumbThickness: number;\r\n\r\n /** Observable raised when the slider value changes */\r\n public onValueChangedObservable = new Observable<number>();\r\n\r\n /** Gets or sets a boolean indicating if the thumb must be rendered */\r\n @serialize()\r\n public get displayThumb(): boolean {\r\n return this._displayThumb;\r\n }\r\n\r\n public set displayThumb(value: boolean) {\r\n if (this._displayThumb === value) {\r\n return;\r\n }\r\n\r\n this._displayThumb = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets a step to apply to values (0 by default) */\r\n @serialize()\r\n public get step(): number {\r\n return this._step;\r\n }\r\n\r\n public set step(value: number) {\r\n if (this._step === value) {\r\n return;\r\n }\r\n\r\n this._step = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets main bar offset (ie. the margin applied to the value bar) */\r\n @serialize()\r\n public get barOffset(): string | number {\r\n return this._barOffset.toString(this._host);\r\n }\r\n\r\n /** Gets main bar offset in pixels*/\r\n public get barOffsetInPixels(): number {\r\n return this._barOffset.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n }\r\n\r\n public set barOffset(value: string | number) {\r\n if (this._barOffset.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._barOffset.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /** Gets or sets thumb width */\r\n @serialize()\r\n public get thumbWidth(): string | number {\r\n return this._thumbWidth.toString(this._host);\r\n }\r\n\r\n /** Gets thumb width in pixels */\r\n public get thumbWidthInPixels(): number {\r\n return this._thumbWidth.getValueInPixel(this._host, this._cachedParentMeasure.width);\r\n }\r\n\r\n public set thumbWidth(value: string | number) {\r\n if (this._thumbWidth.toString(this._host) === value) {\r\n return;\r\n }\r\n\r\n if (this._thumbWidth.fromString(value)) {\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /** Gets or sets minimum value */\r\n @serialize()\r\n public get minimum(): number {\r\n return this._minimum;\r\n }\r\n\r\n public set minimum(value: number) {\r\n if (this._minimum === value) {\r\n return;\r\n }\r\n\r\n this._minimum = value;\r\n this._markAsDirty();\r\n\r\n this.value = Math.max(Math.min(this.value, this._maximum), this._minimum);\r\n }\r\n\r\n /** Gets or sets maximum value */\r\n @serialize()\r\n public get maximum(): number {\r\n return this._maximum;\r\n }\r\n\r\n public set maximum(value: number) {\r\n if (this._maximum === value) {\r\n return;\r\n }\r\n\r\n this._maximum = value;\r\n this._markAsDirty();\r\n\r\n this.value = Math.max(Math.min(this.value, this._maximum), this._minimum);\r\n }\r\n\r\n /** Gets or sets current value */\r\n @serialize()\r\n public get value(): number {\r\n return this._value;\r\n }\r\n\r\n public set value(value: number) {\r\n value = Math.max(Math.min(value, this._maximum), this._minimum);\r\n\r\n if (this._value === value) {\r\n return;\r\n }\r\n\r\n this._value = value;\r\n this._markAsDirty();\r\n this.onValueChangedObservable.notifyObservers(this._value);\r\n }\r\n\r\n /**Gets or sets a boolean indicating if the slider should be vertical or horizontal */\r\n @serialize()\r\n public get isVertical(): boolean {\r\n return this._isVertical;\r\n }\r\n\r\n public set isVertical(value: boolean) {\r\n if (this._isVertical === value) {\r\n return;\r\n }\r\n\r\n this._isVertical = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets a value indicating if the thumb can go over main bar extends */\r\n @serialize()\r\n public get isThumbClamped(): boolean {\r\n return this._isThumbClamped;\r\n }\r\n\r\n public set isThumbClamped(value: boolean) {\r\n if (this._isThumbClamped === value) {\r\n return;\r\n }\r\n\r\n this._isThumbClamped = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Creates a new BaseSlider\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 this.isPointerBlocker = true;\r\n }\r\n\r\n protected override _getTypeName(): string {\r\n return \"BaseSlider\";\r\n }\r\n\r\n protected _getThumbPosition() {\r\n if (this.isVertical) {\r\n return ((this.maximum - this.value) / (this.maximum - this.minimum)) * this._backgroundBoxLength;\r\n }\r\n\r\n return ((this.value - this.minimum) / (this.maximum - this.minimum)) * this._backgroundBoxLength;\r\n }\r\n\r\n protected _getThumbThickness(type: string): number {\r\n let thumbThickness = 0;\r\n switch (type) {\r\n case \"circle\":\r\n if (this._thumbWidth.isPixel) {\r\n thumbThickness = Math.max(this._thumbWidth.getValue(this._host), this._backgroundBoxThickness);\r\n } else {\r\n thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host);\r\n }\r\n break;\r\n case \"rectangle\":\r\n if (this._thumbWidth.isPixel) {\r\n thumbThickness = Math.min(this._thumbWidth.getValue(this._host), this._backgroundBoxThickness);\r\n } else {\r\n thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host);\r\n }\r\n }\r\n return thumbThickness;\r\n }\r\n\r\n protected _prepareRenderingData(type: string) {\r\n // Main bar\r\n this._effectiveBarOffset = 0;\r\n this._renderLeft = this._currentMeasure.left;\r\n this._renderTop = this._currentMeasure.top;\r\n this._renderWidth = this._currentMeasure.width;\r\n this._renderHeight = this._currentMeasure.height;\r\n\r\n this._backgroundBoxLength = Math.max(this._currentMeasure.width, this._currentMeasure.height);\r\n this._backgroundBoxThickness = Math.min(this._currentMeasure.width, this._currentMeasure.height);\r\n this._effectiveThumbThickness = this._getThumbThickness(type);\r\n\r\n if (this.displayThumb) {\r\n this._backgroundBoxLength -= this._effectiveThumbThickness;\r\n }\r\n //throw error when height is less than width for vertical slider\r\n if (this.isVertical && this._currentMeasure.height < this._currentMeasure.width) {\r\n Logger.Error(\"Height should be greater than width\");\r\n return;\r\n }\r\n if (this._barOffset.isPixel) {\r\n this._effectiveBarOffset = Math.min(this._barOffset.getValue(this._host), this._backgroundBoxThickness);\r\n } else {\r\n this._effectiveBarOffset = this._backgroundBoxThickness * this._barOffset.getValue(this._host);\r\n }\r\n\r\n this._backgroundBoxThickness -= this._effectiveBarOffset * 2;\r\n\r\n if (this.isVertical) {\r\n this._renderLeft += this._effectiveBarOffset;\r\n if (!this.isThumbClamped && this.displayThumb) {\r\n this._renderTop += this._effectiveThumbThickness / 2;\r\n }\r\n\r\n this._renderHeight = this._backgroundBoxLength;\r\n this._renderWidth = this._backgroundBoxThickness;\r\n } else {\r\n this._renderTop += this._effectiveBarOffset;\r\n if (!this.isThumbClamped && this.displayThumb) {\r\n this._renderLeft += this._effectiveThumbThickness / 2;\r\n }\r\n this._renderHeight = this._backgroundBoxThickness;\r\n this._renderWidth = this._backgroundBoxLength;\r\n }\r\n }\r\n\r\n // Events\r\n private _pointerIsDown = false;\r\n\r\n /**\r\n * @internal\r\n */\r\n protected _updateValueFromPointer(x: number, y: number): void {\r\n if (this.rotation != 0) {\r\n this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition);\r\n x = this._transformedPosition.x;\r\n y = this._transformedPosition.y;\r\n }\r\n\r\n let value: number;\r\n if (this._isVertical) {\r\n value = this._minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this._maximum - this._minimum);\r\n } else {\r\n value = this._minimum + ((x - this._currentMeasure.left) / this._currentMeasure.width) * (this._maximum - this._minimum);\r\n }\r\n this.value = this._step ? Math.round(value / this._step) * this._step : value;\r\n }\r\n\r\n public override _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean {\r\n if (!super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi)) {\r\n return false;\r\n }\r\n\r\n if (this.isReadOnly) {\r\n return true;\r\n }\r\n\r\n this._pointerIsDown = true;\r\n\r\n this._updateValueFromPointer(coordinates.x, coordinates.y);\r\n this._host._capturingControl[pointerId] = this;\r\n this._lastPointerDownId = pointerId;\r\n return true;\r\n }\r\n\r\n public override _onPointerMove(target: Control, coordinates: Vector2, pointerId: number, pi: PointerInfoBase): void {\r\n // Only listen to pointer move events coming from the last pointer to click on the element (To support dual vr controller interaction)\r\n if (pointerId != this._lastPointerDownId) {\r\n return;\r\n }\r\n\r\n if (this._pointerIsDown && !this.isReadOnly) {\r\n this._updateValueFromPointer(coordinates.x, coordinates.y);\r\n }\r\n\r\n super._onPointerMove(target, coordinates, pointerId, pi);\r\n }\r\n\r\n public override _onPointerUp(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, notifyClick: boolean): void {\r\n this._pointerIsDown = false;\r\n\r\n delete this._host._capturingControl[pointerId];\r\n super._onPointerUp(target, coordinates, pointerId, buttonIndex, notifyClick);\r\n }\r\n\r\n public override _onCanvasBlur(): void {\r\n this._forcePointerUp();\r\n super._onCanvasBlur();\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"imageBasedSlider.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/2D/controls/sliders/imageBasedSlider.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,aAAa,EAAE,0CAA4B;AACpD,OAAO,EAAE,SAAS,EAAE,2CAA6B;AAIjD;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,UAAU;IAO5C,IAAoB,YAAY;QAC5B,OAAO,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC;IACzD,CAAC;IAED,IAAoB,YAAY,CAAC,KAAc;QAC3C,IAAI,IAAI,CAAC,aAAa,KAAK,KAAK,EAAE;YAC9B,OAAO;SACV;QAED,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;QAC3B,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAED;;OAEG;IACH,IAAW,eAAe;QACtB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IACjC,CAAC;IAED,IAAW,eAAe,CAAC,KAAY;QACnC,IAAI,IAAI,CAAC,g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E,IAAI,CAAU,CAAC;IACpF,CAAC;CACJ;AAnLG;IADC,SAAS,EAAE;oDAGX;AAkLL,aAAa,CAAC,8BAA8B,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import { BaseSlider } from \"./baseSlider\";\r\nimport { Measure } from \"../../measure\";\r\nimport { Image } from \"../image\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport type { ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\nimport type { AdvancedDynamicTexture } from \"../../advancedDynamicTexture\";\r\n\r\n/**\r\n * Class used to create slider controls based on images\r\n */\r\nexport class ImageBasedSlider extends BaseSlider {\r\n private _backgroundImage: Image;\r\n private _thumbImage: Image;\r\n private _valueBarImage: Image;\r\n private _tempMeasure = new Measure(0, 0, 0, 0);\r\n\r\n @serialize()\r\n public override get displayThumb(): boolean {\r\n return this._displayThumb && this.thumbImage != null;\r\n }\r\n\r\n public override set displayThumb(value: boolean) {\r\n if (this._displayThumb === value) {\r\n return;\r\n }\r\n\r\n this._displayThumb = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the image used to render the background\r\n */\r\n public get backgroundImage(): Image {\r\n return this._backgroundImage;\r\n }\r\n\r\n public set backgroundImage(value: Image) {\r\n if (this._backgroundImage === value) {\r\n return;\r\n }\r\n\r\n this._backgroundImage = value;\r\n\r\n if (value && !value.isLoaded) {\r\n value.onImageLoadedObservable.addOnce(() => this._markAsDirty());\r\n }\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the image used to render the value bar\r\n */\r\n public get valueBarImage(): Image {\r\n return this._valueBarImage;\r\n }\r\n\r\n public set valueBarImage(value: Image) {\r\n if (this._valueBarImage === value) {\r\n return;\r\n }\r\n\r\n this._valueBarImage = value;\r\n\r\n if (value && !value.isLoaded) {\r\n value.onImageLoadedObservable.addOnce(() => this._markAsDirty());\r\n }\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the image used to render the thumb\r\n */\r\n public get thumbImage(): Image {\r\n return this._thumbImage;\r\n }\r\n\r\n public set thumbImage(value: Image) {\r\n if (this._thumbImage === value) {\r\n return;\r\n }\r\n\r\n this._thumbImage = value;\r\n\r\n if (value && !value.isLoaded) {\r\n value.onImageLoadedObservable.addOnce(() => this._markAsDirty());\r\n }\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Creates a new ImageBasedSlider\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 \"ImageBasedSlider\";\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 this._prepareRenderingData(\"rectangle\");\r\n const thumbPosition = this._getThumbPosition();\r\n const left = this._renderLeft;\r\n const top = this._renderTop;\r\n const width = this._renderWidth;\r\n const height = this._renderHeight;\r\n\r\n // Background\r\n if (this._backgroundImage) {\r\n this._tempMeasure.copyFromFloats(left, top, width, height);\r\n if (this.isThumbClamped && this.displayThumb) {\r\n if (this.isVertical) {\r\n this._tempMeasure.height += this._effectiveThumbThickness;\r\n } else {\r\n this._tempMeasure.width += this._effectiveThumbThickness;\r\n }\r\n }\r\n this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure);\r\n this._backgroundImage._draw(context);\r\n }\r\n\r\n // Bar\r\n if (this._valueBarImage) {\r\n if (this.isVertical) {\r\n if (this.isThumbClamped && this.displayThumb) {\r\n this._tempMeasure.copyFromFloats(left, top + thumbPosition, width, height - thumbPosition + this._effectiveThumbThickness);\r\n } else {\r\n this._tempMeasure.copyFromFloats(left, top + thumbPosition, width, height - thumbPosition);\r\n }\r\n } else {\r\n if (this.isThumbClamped && this.displayThumb) {\r\n this._tempMeasure.copyFromFloats(left, top, thumbPosition + this._effectiveThumbThickness / 2, height);\r\n } else {\r\n this._tempMeasure.copyFromFloats(left, top, thumbPosition, height);\r\n }\r\n }\r\n this._valueBarImage._currentMeasure.copyFrom(this._tempMeasure);\r\n this._valueBarImage._draw(context);\r\n }\r\n\r\n // Thumb\r\n if (this.displayThumb) {\r\n if (this.isVertical) {\r\n this._tempMeasure.copyFromFloats(\r\n left - this._effectiveBarOffset,\r\n this._currentMeasure.top + thumbPosition,\r\n this._currentMeasure.width,\r\n this._effectiveThumbThickness\r\n );\r\n } else {\r\n this._tempMeasure.copyFromFloats(this._currentMeasure.left + thumbPosition, this._currentMeasure.top, this._effectiveThumbThickness, this._currentMeasure.height);\r\n }\r\n\r\n this._thumbImage._currentMeasure.copyFrom(this._tempMeasure);\r\n this._thumbImage._draw(context);\r\n }\r\n\r\n context.restore();\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 override serialize(serializationObject: any) {\r\n super.serialize(serializationObject);\r\n const backgroundImage = {};\r\n const thumbImage = {};\r\n const valueBarImage = {};\r\n this.backgroundImage.serialize(backgroundImage);\r\n this.thumbImage.serialize(thumbImage);\r\n this.valueBarImage.serialize(valueBarImage);\r\n serializationObject.backgroundImage = backgroundImage;\r\n serializationObject.thumbImage = thumbImage;\r\n serializationObject.valueBarImage = valueBarImage;\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 this.backgroundImage = Image.Parse(serializedObject.backgroundImage, host) as Image;\r\n this.thumbImage = Image.Parse(serializedObject.thumbImage, host) as Image;\r\n this.valueBarImage = Image.Parse(serializedObject.valueBarImage, host) as Image;\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.ImageBasedSlider\", ImageBasedSlider);\r\n"]}
1
+ {"version":3,"file":"imageBasedSlider.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/2D/controls/sliders/imageBasedSlider.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,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AGG;IACa,SAAS,CAAC,mBAAwB;QAC9C,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QACrC,MAAM,eAAe,GAAG,EAAE,CAAC;QAC3B,MAAM,UAAU,GAAG,EAAE,CAAC;QACtB,MAAM,aAAa,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;QAChD,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;QACtC,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QAC5C,mBAAmB,CAAC,eAAe,GAAG,eAAe,CAAC;QACtD,mBAAmB,CAAC,UAAU,GAAG,UAAU,CAAC;QAC5C,mBAAmB,CAAC,aAAa,GAAG,aAAa,CAAC;IACtD,CAAC;IAED;;OAEG;IACa,iBAAiB,CAAC,gBAAqB,EAAE,IAA4B;QACjF,KAAK,CAAC,iBAAiB,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;QAChD,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,eAAe,EAAE,IAAI,CAAU,CAAC;QACpF,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,UAAU,EAAE,IAAI,CAAU,CAAC;QAC1E,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAU,CAAC;IACpF,CAAC;CACJ;AAnLG;IADC,SAAS,EAAE;oDAGX;AAkLL,aAAa,CAAC,8BAA8B,EAAE,gBAAgB,CAAC,CAAC","sourcesContent":["import { BaseSlider } from \"./baseSlider\";\r\nimport { Measure } from \"../../measure\";\r\nimport { Image } from \"../image\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport type { ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\nimport type { AdvancedDynamicTexture } from \"../../advancedDynamicTexture\";\r\n\r\n/**\r\n * Class used to create slider controls based on images\r\n */\r\nexport class ImageBasedSlider extends BaseSlider {\r\n private _backgroundImage: Image;\r\n private _thumbImage: Image;\r\n private _valueBarImage: Image;\r\n private _tempMeasure = new Measure(0, 0, 0, 0);\r\n\r\n @serialize()\r\n public override get displayThumb(): boolean {\r\n return this._displayThumb && this.thumbImage != null;\r\n }\r\n\r\n public override set displayThumb(value: boolean) {\r\n if (this._displayThumb === value) {\r\n return;\r\n }\r\n\r\n this._displayThumb = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the image used to render the background\r\n */\r\n public get backgroundImage(): Image {\r\n return this._backgroundImage;\r\n }\r\n\r\n public set backgroundImage(value: Image) {\r\n if (this._backgroundImage === value) {\r\n return;\r\n }\r\n\r\n this._backgroundImage = value;\r\n\r\n if (value && !value.isLoaded) {\r\n value.onImageLoadedObservable.addOnce(() => this._markAsDirty());\r\n }\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the image used to render the value bar\r\n */\r\n public get valueBarImage(): Image {\r\n return this._valueBarImage;\r\n }\r\n\r\n public set valueBarImage(value: Image) {\r\n if (this._valueBarImage === value) {\r\n return;\r\n }\r\n\r\n this._valueBarImage = value;\r\n\r\n if (value && !value.isLoaded) {\r\n value.onImageLoadedObservable.addOnce(() => this._markAsDirty());\r\n }\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the image used to render the thumb\r\n */\r\n public get thumbImage(): Image {\r\n return this._thumbImage;\r\n }\r\n\r\n public set thumbImage(value: Image) {\r\n if (this._thumbImage === value) {\r\n return;\r\n }\r\n\r\n this._thumbImage = value;\r\n\r\n if (value && !value.isLoaded) {\r\n value.onImageLoadedObservable.addOnce(() => this._markAsDirty());\r\n }\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Creates a new ImageBasedSlider\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 \"ImageBasedSlider\";\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 this._prepareRenderingData(\"rectangle\");\r\n const thumbPosition = this._getThumbPosition();\r\n const left = this._renderLeft;\r\n const top = this._renderTop;\r\n const width = this._renderWidth;\r\n const height = this._renderHeight;\r\n\r\n // Background\r\n if (this._backgroundImage) {\r\n this._tempMeasure.copyFromFloats(left, top, width, height);\r\n if (this.isThumbClamped && this.displayThumb) {\r\n if (this.isVertical) {\r\n this._tempMeasure.height += this._effectiveThumbThickness;\r\n } else {\r\n this._tempMeasure.width += this._effectiveThumbThickness;\r\n }\r\n }\r\n this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure);\r\n this._backgroundImage._draw(context);\r\n }\r\n\r\n // Bar\r\n if (this._valueBarImage) {\r\n if (this.isVertical) {\r\n if (this.isThumbClamped && this.displayThumb) {\r\n this._tempMeasure.copyFromFloats(left, top + thumbPosition, width, height - thumbPosition + this._effectiveThumbThickness);\r\n } else {\r\n this._tempMeasure.copyFromFloats(left, top + thumbPosition, width, height - thumbPosition);\r\n }\r\n } else {\r\n if (this.isThumbClamped && this.displayThumb) {\r\n this._tempMeasure.copyFromFloats(left, top, thumbPosition + this._effectiveThumbThickness / 2, height);\r\n } else {\r\n this._tempMeasure.copyFromFloats(left, top, thumbPosition, height);\r\n }\r\n }\r\n this._valueBarImage._currentMeasure.copyFrom(this._tempMeasure);\r\n this._valueBarImage._draw(context);\r\n }\r\n\r\n // Thumb\r\n if (this.displayThumb) {\r\n if (this.isVertical) {\r\n this._tempMeasure.copyFromFloats(\r\n left - this._effectiveBarOffset,\r\n this._currentMeasure.top + thumbPosition,\r\n this._currentMeasure.width,\r\n this._effectiveThumbThickness\r\n );\r\n } else {\r\n this._tempMeasure.copyFromFloats(this._currentMeasure.left + thumbPosition, this._currentMeasure.top, this._effectiveThumbThickness, this._currentMeasure.height);\r\n }\r\n\r\n this._thumbImage._currentMeasure.copyFrom(this._tempMeasure);\r\n this._thumbImage._draw(context);\r\n }\r\n\r\n context.restore();\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 override serialize(serializationObject: any) {\r\n super.serialize(serializationObject);\r\n const backgroundImage = {};\r\n const thumbImage = {};\r\n const valueBarImage = {};\r\n this.backgroundImage.serialize(backgroundImage);\r\n this.thumbImage.serialize(thumbImage);\r\n this.valueBarImage.serialize(valueBarImage);\r\n serializationObject.backgroundImage = backgroundImage;\r\n serializationObject.thumbImage = thumbImage;\r\n serializationObject.valueBarImage = valueBarImage;\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 this.backgroundImage = Image.Parse(serializedObject.backgroundImage, host) as Image;\r\n this.thumbImage = Image.Parse(serializedObject.thumbImage, host) as Image;\r\n this.valueBarImage = Image.Parse(serializedObject.valueBarImage, host) as Image;\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.ImageBasedSlider\", ImageBasedSlider);\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"imageScrollBar.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/2D/controls/sliders/imageScrollBar.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,2CAA6B;AAGjD;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,UAAU;IAe1C,uDAAuD;IAEvD,IAAW,qBAAqB;QAC5B,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACvC,CAAC;IAED,IAAW,qBAAqB,CAAC,MAAe;QAC5C,IAAI,CAAC,sBAAsB,GAAG,MAAM,CAA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WAAW,EAAE,EAAE,CAAC,CAAC;IACjF,CAAC;CACJ;AApRU;IADN,SAAS,EAAE;mEAC2B;AAIvC;IADC,SAAS,EAAE;2DAGX","sourcesContent":["import type { Vector2 } from \"core/Maths/math.vector\";\r\nimport { BaseSlider } from \"./baseSlider\";\r\nimport type { Control } from \"../control\";\r\nimport type { Image } from \"../image\";\r\nimport { Measure } from \"../../measure\";\r\nimport type { PointerInfoBase } from \"core/Events/pointerEvents\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport type { ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\n\r\n/**\r\n * Class used to create slider controls\r\n */\r\nexport class ImageScrollBar extends BaseSlider {\r\n private _backgroundBaseImage: Image;\r\n private _backgroundImage: Image;\r\n private _thumbImage: Image;\r\n private _thumbBaseImage: Image;\r\n private _thumbLength: number = 0.5;\r\n private _thumbHeight: number = 1;\r\n private _barImageHeight: number = 1;\r\n private _tempMeasure = new Measure(0, 0, 0, 0);\r\n private _invertScrollDirection = false;\r\n\r\n /** Number of 90° rotation to apply on the images when in vertical mode */\r\n @serialize()\r\n public num90RotationInVerticalMode = 1;\r\n\r\n /** Inverts the scrolling direction (default: false) */\r\n @serialize()\r\n public get invertScrollDirection() {\r\n return this._invertScrollDirection;\r\n }\r\n\r\n public set invertScrollDirection(invert: boolean) {\r\n this._invertScrollDirection = invert;\r\n }\r\n\r\n /**\r\n * Gets or sets the image used to render the background for horizontal bar\r\n */\r\n public get backgroundImage(): Image {\r\n return this._backgroundBaseImage;\r\n }\r\n\r\n public set backgroundImage(value: Image) {\r\n if (this._backgroundBaseImage === value) {\r\n return;\r\n }\r\n\r\n this._backgroundBaseImage = value;\r\n\r\n if (this.isVertical && this.num90RotationInVerticalMode !== 0) {\r\n if (!value.isLoaded) {\r\n value.onImageLoadedObservable.addOnce(() => {\r\n const rotatedValue = value._rotate90(this.num90RotationInVerticalMode, true);\r\n this._backgroundImage = rotatedValue;\r\n if (!rotatedValue.isLoaded) {\r\n rotatedValue.onImageLoadedObservable.addOnce(() => {\r\n this._markAsDirty();\r\n });\r\n }\r\n this._markAsDirty();\r\n });\r\n } else {\r\n this._backgroundImage = value._rotate90(this.num90RotationInVerticalMode, true);\r\n this._markAsDirty();\r\n }\r\n } else {\r\n this._backgroundImage = value;\r\n if (value && !value.isLoaded) {\r\n value.onImageLoadedObservable.addOnce(() => {\r\n this._markAsDirty();\r\n });\r\n }\r\n\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the image used to render the thumb\r\n */\r\n public get thumbImage(): Image {\r\n return this._thumbBaseImage;\r\n }\r\n\r\n public set thumbImage(value: Image) {\r\n if (this._thumbBaseImage === value) {\r\n return;\r\n }\r\n\r\n this._thumbBaseImage = value;\r\n\r\n if (this.isVertical && this.num90RotationInVerticalMode !== 0) {\r\n if (!value.isLoaded) {\r\n value.onImageLoadedObservable.addOnce(() => {\r\n const rotatedValue = value._rotate90(-this.num90RotationInVerticalMode, true);\r\n this._thumbImage = rotatedValue;\r\n if (!rotatedValue.isLoaded) {\r\n rotatedValue.onImageLoadedObservable.addOnce(() => {\r\n this._markAsDirty();\r\n });\r\n }\r\n this._markAsDirty();\r\n });\r\n } else {\r\n this._thumbImage = value._rotate90(-this.num90RotationInVerticalMode, true);\r\n this._markAsDirty();\r\n }\r\n } else {\r\n this._thumbImage = value;\r\n if (value && !value.isLoaded) {\r\n value.onImageLoadedObservable.addOnce(() => {\r\n this._markAsDirty();\r\n });\r\n }\r\n\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the length of the thumb\r\n */\r\n public get thumbLength(): number {\r\n return this._thumbLength;\r\n }\r\n\r\n public set thumbLength(value: number) {\r\n if (this._thumbLength === value) {\r\n return;\r\n }\r\n\r\n this._thumbLength = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the height of the thumb\r\n */\r\n public get thumbHeight(): number {\r\n return this._thumbHeight;\r\n }\r\n\r\n public set thumbHeight(value: number) {\r\n if (this._thumbLength === value) {\r\n return;\r\n }\r\n\r\n this._thumbHeight = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the height of the bar image\r\n */\r\n public get barImageHeight(): number {\r\n return this._barImageHeight;\r\n }\r\n\r\n public set barImageHeight(value: number) {\r\n if (this._barImageHeight === value) {\r\n return;\r\n }\r\n\r\n this._barImageHeight = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Creates a new ImageScrollBar\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 \"ImageScrollBar\";\r\n }\r\n\r\n protected override _getThumbThickness(): number {\r\n let thumbThickness = 0;\r\n if (this._thumbWidth.isPixel) {\r\n thumbThickness = this._thumbWidth.getValue(this._host);\r\n } else {\r\n thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host);\r\n }\r\n return thumbThickness;\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 this._prepareRenderingData(\"rectangle\");\r\n const thumbPosition = this._getThumbPosition();\r\n const left = this._renderLeft;\r\n const top = this._renderTop;\r\n const width = this._renderWidth;\r\n const height = this._renderHeight;\r\n\r\n // Background\r\n if (this._backgroundImage) {\r\n this._tempMeasure.copyFromFloats(left, top, width, height);\r\n if (this.isVertical) {\r\n this._tempMeasure.copyFromFloats(left + width * (1 - this._barImageHeight) * 0.5, this._currentMeasure.top, width * this._barImageHeight, height);\r\n this._tempMeasure.height += this._effectiveThumbThickness;\r\n this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure);\r\n } else {\r\n this._tempMeasure.copyFromFloats(this._currentMeasure.left, top + height * (1 - this._barImageHeight) * 0.5, width, height * this._barImageHeight);\r\n this._tempMeasure.width += this._effectiveThumbThickness;\r\n this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure);\r\n }\r\n this._backgroundImage._draw(context);\r\n }\r\n\r\n // Thumb\r\n if (this.isVertical) {\r\n this._tempMeasure.copyFromFloats(\r\n left - this._effectiveBarOffset + this._currentMeasure.width * (1 - this._thumbHeight) * 0.5,\r\n this._currentMeasure.top + thumbPosition,\r\n this._currentMeasure.width * this._thumbHeight,\r\n this._effectiveThumbThickness\r\n );\r\n } else {\r\n this._tempMeasure.copyFromFloats(\r\n this._currentMeasure.left + thumbPosition,\r\n this._currentMeasure.top + this._currentMeasure.height * (1 - this._thumbHeight) * 0.5,\r\n this._effectiveThumbThickness,\r\n this._currentMeasure.height * this._thumbHeight\r\n );\r\n }\r\n\r\n if (this._thumbImage) {\r\n this._thumbImage._currentMeasure.copyFrom(this._tempMeasure);\r\n this._thumbImage._draw(context);\r\n }\r\n\r\n context.restore();\r\n }\r\n\r\n private _first: boolean;\r\n private _originX: number;\r\n private _originY: number;\r\n\r\n /**\r\n * @internal\r\n */\r\n protected override _updateValueFromPointer(x: number, y: number): void {\r\n if (this.rotation != 0) {\r\n this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition);\r\n x = this._transformedPosition.x;\r\n y = this._transformedPosition.y;\r\n }\r\n\r\n const sign = this._invertScrollDirection ? -1 : 1;\r\n\r\n if (this._first) {\r\n this._first = false;\r\n this._originX = x;\r\n this._originY = y;\r\n\r\n // Check if move is required\r\n if (\r\n x < this._tempMeasure.left ||\r\n x > this._tempMeasure.left + this._tempMeasure.width ||\r\n y < this._tempMeasure.top ||\r\n y > this._tempMeasure.top + this._tempMeasure.height\r\n ) {\r\n if (this.isVertical) {\r\n this.value = this.minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this.maximum - this.minimum);\r\n } else {\r\n this.value = this.minimum + ((x - this._currentMeasure.left) / this._currentMeasure.width) * (this.maximum - this.minimum);\r\n }\r\n }\r\n }\r\n\r\n // Delta mode\r\n let delta = 0;\r\n if (this.isVertical) {\r\n delta = -((y - this._originY) / (this._currentMeasure.height - this._effectiveThumbThickness));\r\n } else {\r\n delta = (x - this._originX) / (this._currentMeasure.width - this._effectiveThumbThickness);\r\n }\r\n\r\n this.value += sign * delta * (this.maximum - this.minimum);\r\n\r\n this._originX = x;\r\n this._originY = y;\r\n }\r\n\r\n public override _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean {\r\n this._first = true;\r\n\r\n return super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"imageScrollBar.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/2D/controls/sliders/imageScrollBar.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,2CAA6B;AAGjD;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,UAAU;IAe1C,uDAAuD;IAEvD,IAAW,qBAAqB;QAC5B,OAAO,IAAI,CAAC,sBAAsB,CAAC;IACvC,CAAC;IAED,IAAW,qBAAqB,CAAC,MAAe;QAC5C,IAAI,CAAC,sBAAsB,GAAG,MAAM,CAAC;IACzC,CAAC;IAED;;OAEG;IACH,IAAW,eAAe;QACtB,OAAO,IAAI,CAAC,oBAAoB,CAAC;IACrC,CAAC;IAED,IAAW,eAAe,CAAC,KAAY;QACnC,IAAI,IAAI,CAAC,oBAAoB,KAAK,KAAK,EAAE,CAAC;YACtC,OAAO;QACX,CAAC;QAED,IAAI,CAAC,oBAAoB,GAAG,KAAK,CAAC;QAElC,IAAI,IAAI,CAAC,UAAU,IAAI,IAAI,CAAC,2BAA2B,KAAK,CAAC,EAAE,CAAC;YAC5D,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;gBAClB,KAAK,CAAC,uBAAuB,CAAC,OAAO,CAAC,GAAG,EAAE;oBACvC,MAAM,YAAY,GAAG,KAAK,CAAC,SAA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vC;IADC,SAAS,EAAE;2DAGX","sourcesContent":["import type { Vector2 } from \"core/Maths/math.vector\";\r\nimport { BaseSlider } from \"./baseSlider\";\r\nimport type { Control } from \"../control\";\r\nimport type { Image } from \"../image\";\r\nimport { Measure } from \"../../measure\";\r\nimport type { PointerInfoBase } from \"core/Events/pointerEvents\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport type { ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\n\r\n/**\r\n * Class used to create slider controls\r\n */\r\nexport class ImageScrollBar extends BaseSlider {\r\n private _backgroundBaseImage: Image;\r\n private _backgroundImage: Image;\r\n private _thumbImage: Image;\r\n private _thumbBaseImage: Image;\r\n private _thumbLength: number = 0.5;\r\n private _thumbHeight: number = 1;\r\n private _barImageHeight: number = 1;\r\n private _tempMeasure = new Measure(0, 0, 0, 0);\r\n private _invertScrollDirection = false;\r\n\r\n /** Number of 90° rotation to apply on the images when in vertical mode */\r\n @serialize()\r\n public num90RotationInVerticalMode = 1;\r\n\r\n /** Inverts the scrolling direction (default: false) */\r\n @serialize()\r\n public get invertScrollDirection() {\r\n return this._invertScrollDirection;\r\n }\r\n\r\n public set invertScrollDirection(invert: boolean) {\r\n this._invertScrollDirection = invert;\r\n }\r\n\r\n /**\r\n * Gets or sets the image used to render the background for horizontal bar\r\n */\r\n public get backgroundImage(): Image {\r\n return this._backgroundBaseImage;\r\n }\r\n\r\n public set backgroundImage(value: Image) {\r\n if (this._backgroundBaseImage === value) {\r\n return;\r\n }\r\n\r\n this._backgroundBaseImage = value;\r\n\r\n if (this.isVertical && this.num90RotationInVerticalMode !== 0) {\r\n if (!value.isLoaded) {\r\n value.onImageLoadedObservable.addOnce(() => {\r\n const rotatedValue = value._rotate90(this.num90RotationInVerticalMode, true);\r\n this._backgroundImage = rotatedValue;\r\n if (!rotatedValue.isLoaded) {\r\n rotatedValue.onImageLoadedObservable.addOnce(() => {\r\n this._markAsDirty();\r\n });\r\n }\r\n this._markAsDirty();\r\n });\r\n } else {\r\n this._backgroundImage = value._rotate90(this.num90RotationInVerticalMode, true);\r\n this._markAsDirty();\r\n }\r\n } else {\r\n this._backgroundImage = value;\r\n if (value && !value.isLoaded) {\r\n value.onImageLoadedObservable.addOnce(() => {\r\n this._markAsDirty();\r\n });\r\n }\r\n\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the image used to render the thumb\r\n */\r\n public get thumbImage(): Image {\r\n return this._thumbBaseImage;\r\n }\r\n\r\n public set thumbImage(value: Image) {\r\n if (this._thumbBaseImage === value) {\r\n return;\r\n }\r\n\r\n this._thumbBaseImage = value;\r\n\r\n if (this.isVertical && this.num90RotationInVerticalMode !== 0) {\r\n if (!value.isLoaded) {\r\n value.onImageLoadedObservable.addOnce(() => {\r\n const rotatedValue = value._rotate90(-this.num90RotationInVerticalMode, true);\r\n this._thumbImage = rotatedValue;\r\n if (!rotatedValue.isLoaded) {\r\n rotatedValue.onImageLoadedObservable.addOnce(() => {\r\n this._markAsDirty();\r\n });\r\n }\r\n this._markAsDirty();\r\n });\r\n } else {\r\n this._thumbImage = value._rotate90(-this.num90RotationInVerticalMode, true);\r\n this._markAsDirty();\r\n }\r\n } else {\r\n this._thumbImage = value;\r\n if (value && !value.isLoaded) {\r\n value.onImageLoadedObservable.addOnce(() => {\r\n this._markAsDirty();\r\n });\r\n }\r\n\r\n this._markAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Gets or sets the length of the thumb\r\n */\r\n public get thumbLength(): number {\r\n return this._thumbLength;\r\n }\r\n\r\n public set thumbLength(value: number) {\r\n if (this._thumbLength === value) {\r\n return;\r\n }\r\n\r\n this._thumbLength = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the height of the thumb\r\n */\r\n public get thumbHeight(): number {\r\n return this._thumbHeight;\r\n }\r\n\r\n public set thumbHeight(value: number) {\r\n if (this._thumbLength === value) {\r\n return;\r\n }\r\n\r\n this._thumbHeight = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Gets or sets the height of the bar image\r\n */\r\n public get barImageHeight(): number {\r\n return this._barImageHeight;\r\n }\r\n\r\n public set barImageHeight(value: number) {\r\n if (this._barImageHeight === value) {\r\n return;\r\n }\r\n\r\n this._barImageHeight = value;\r\n\r\n this._markAsDirty();\r\n }\r\n\r\n /**\r\n * Creates a new ImageScrollBar\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 \"ImageScrollBar\";\r\n }\r\n\r\n protected override _getThumbThickness(): number {\r\n let thumbThickness = 0;\r\n if (this._thumbWidth.isPixel) {\r\n thumbThickness = this._thumbWidth.getValue(this._host);\r\n } else {\r\n thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host);\r\n }\r\n return thumbThickness;\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 this._prepareRenderingData(\"rectangle\");\r\n const thumbPosition = this._getThumbPosition();\r\n const left = this._renderLeft;\r\n const top = this._renderTop;\r\n const width = this._renderWidth;\r\n const height = this._renderHeight;\r\n\r\n // Background\r\n if (this._backgroundImage) {\r\n this._tempMeasure.copyFromFloats(left, top, width, height);\r\n if (this.isVertical) {\r\n this._tempMeasure.copyFromFloats(left + width * (1 - this._barImageHeight) * 0.5, this._currentMeasure.top, width * this._barImageHeight, height);\r\n this._tempMeasure.height += this._effectiveThumbThickness;\r\n this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure);\r\n } else {\r\n this._tempMeasure.copyFromFloats(this._currentMeasure.left, top + height * (1 - this._barImageHeight) * 0.5, width, height * this._barImageHeight);\r\n this._tempMeasure.width += this._effectiveThumbThickness;\r\n this._backgroundImage._currentMeasure.copyFrom(this._tempMeasure);\r\n }\r\n this._backgroundImage._draw(context);\r\n }\r\n\r\n // Thumb\r\n if (this.isVertical) {\r\n this._tempMeasure.copyFromFloats(\r\n left - this._effectiveBarOffset + this._currentMeasure.width * (1 - this._thumbHeight) * 0.5,\r\n this._currentMeasure.top + thumbPosition,\r\n this._currentMeasure.width * this._thumbHeight,\r\n this._effectiveThumbThickness\r\n );\r\n } else {\r\n this._tempMeasure.copyFromFloats(\r\n this._currentMeasure.left + thumbPosition,\r\n this._currentMeasure.top + this._currentMeasure.height * (1 - this._thumbHeight) * 0.5,\r\n this._effectiveThumbThickness,\r\n this._currentMeasure.height * this._thumbHeight\r\n );\r\n }\r\n\r\n if (this._thumbImage) {\r\n this._thumbImage._currentMeasure.copyFrom(this._tempMeasure);\r\n this._thumbImage._draw(context);\r\n }\r\n\r\n context.restore();\r\n }\r\n\r\n private _first: boolean;\r\n private _originX: number;\r\n private _originY: number;\r\n\r\n /**\r\n * @internal\r\n */\r\n protected override _updateValueFromPointer(x: number, y: number): void {\r\n if (this.rotation != 0) {\r\n this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition);\r\n x = this._transformedPosition.x;\r\n y = this._transformedPosition.y;\r\n }\r\n\r\n const sign = this._invertScrollDirection ? -1 : 1;\r\n\r\n if (this._first) {\r\n this._first = false;\r\n this._originX = x;\r\n this._originY = y;\r\n\r\n // Check if move is required\r\n if (\r\n x < this._tempMeasure.left ||\r\n x > this._tempMeasure.left + this._tempMeasure.width ||\r\n y < this._tempMeasure.top ||\r\n y > this._tempMeasure.top + this._tempMeasure.height\r\n ) {\r\n if (this.isVertical) {\r\n this.value = this.minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this.maximum - this.minimum);\r\n } else {\r\n this.value = this.minimum + ((x - this._currentMeasure.left) / this._currentMeasure.width) * (this.maximum - this.minimum);\r\n }\r\n }\r\n }\r\n\r\n // Delta mode\r\n let delta = 0;\r\n if (this.isVertical) {\r\n delta = -((y - this._originY) / (this._currentMeasure.height - this._effectiveThumbThickness));\r\n } else {\r\n delta = (x - this._originX) / (this._currentMeasure.width - this._effectiveThumbThickness);\r\n }\r\n\r\n this.value += sign * delta * (this.maximum - this.minimum);\r\n\r\n this._originX = x;\r\n this._originY = y;\r\n }\r\n\r\n public override _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean {\r\n this._first = true;\r\n\r\n return super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"scrollBar.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/2D/controls/sliders/scrollBar.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,2CAA6B;AAKjD,OAAO,EAAE,KAAK,EAAE,sCAAwB;AACxC,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAEpD;;GAEG;AACH,MAAM,OAAO,SAAU,SAAQ,UAAU;IAOrC,gCAAgC;IAEhC,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED,IAAW,WAAW,CAAC,KAAa;QAChC,IAAI,IAAI,CAAC,YAAY,KAAK,KAAK,EAAE;YAC7B,OAAO;SACV;QAED,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC;QAC1B,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAED,oCAAoC;IAEpC,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;IACxB,CAAC;IAED,wEAAwE;IACxE,IAAW,kBAAkB;QACzB,OAAO,IAAI,CAAC,mBAAmB,CAAC;IACpC,CAAC;IAED,IAAW,kBA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QAC7H,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QAEnB,OAAO,KAAK,CAAC,cAAc,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,CAAC,CAAC;IACjF,CAAC;IAEe,SAAS,CAAC,mBAAwB;QAC9C,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QAErC,IAAI,IAAI,CAAC,kBAAkB,EAAE;YACzB,mBAAmB,CAAC,kBAAkB,GAAG,EAAE,CAAC;YAC5C,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;SAC7E;IACL,CAAC;IAEe,iBAAiB,CAAC,mBAAwB,EAAE,IAA4B;QACpF,KAAK,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;QAEnD,IAAI,mBAAmB,CAAC,kBAAkB,EAAE;YACxC,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,CAAC,cAAc,GAAG,mBAAmB,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;YACvG,IAAI,CAAC,kBAAkB,GAAG,IAAI,SAAS,EAAE,CAAC;YAC1C,IAAI,CAAC,kBAAmB,CAAC,KAAK,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;SAC1E;IACL,CAAC;CACJ;AAzLG;IADC,SAAS,EAAE;4CAGX;AAaD;IADC,SAAS,EAAE;2CAGX;AA2BD;IADC,SAAS,EAAE;sDAGX;AA4IL,aAAa,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import type { Vector2 } from \"core/Maths/math.vector\";\r\nimport { BaseSlider } from \"./baseSlider\";\r\nimport type { Control } from \"../control\";\r\nimport { Measure } from \"../../measure\";\r\nimport type { PointerInfoBase } from \"core/Events/pointerEvents\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport type { ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { BaseGradient } from \"../gradient/BaseGradient\";\r\nimport type { AdvancedDynamicTexture } from \"gui/2D/advancedDynamicTexture\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\n\r\n/**\r\n * Class used to create slider controls\r\n */\r\nexport class ScrollBar extends BaseSlider {\r\n private _background = \"black\";\r\n private _borderColor = \"white\";\r\n private _tempMeasure = new Measure(0, 0, 0, 0);\r\n private _invertScrollDirection = false;\r\n private _backgroundGradient: Nullable<BaseGradient> = null;\r\n\r\n /** Gets or sets border color */\r\n @serialize()\r\n public get borderColor(): string {\r\n return this._borderColor;\r\n }\r\n\r\n public set borderColor(value: string) {\r\n if (this._borderColor === value) {\r\n return;\r\n }\r\n\r\n this._borderColor = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets background color */\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 background gradient. Takes precedence over gradient. */\r\n public get backgroundGradient(): Nullable<BaseGradient> {\r\n return this._backgroundGradient;\r\n }\r\n\r\n public set backgroundGradient(value: Nullable<BaseGradient>) {\r\n if (this._backgroundGradient === value) {\r\n return;\r\n }\r\n\r\n this._backgroundGradient = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Inverts the scrolling direction (default: false) */\r\n @serialize()\r\n public get invertScrollDirection() {\r\n return this._invertScrollDirection;\r\n }\r\n\r\n public set invertScrollDirection(invert: boolean) {\r\n this._invertScrollDirection = invert;\r\n }\r\n\r\n /**\r\n * Creates a new Slider\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 \"Scrollbar\";\r\n }\r\n\r\n protected override _getThumbThickness(): number {\r\n let thumbThickness = 0;\r\n if (this._thumbWidth.isPixel) {\r\n thumbThickness = this._thumbWidth.getValue(this._host);\r\n } else {\r\n thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host);\r\n }\r\n return thumbThickness;\r\n }\r\n\r\n private _getBackgroundColor(context: ICanvasRenderingContext) {\r\n return this._backgroundGradient ? this._backgroundGradient.getCanvasGradient(context) : this._background;\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 this._prepareRenderingData(\"rectangle\");\r\n const left = this._renderLeft;\r\n\r\n const thumbPosition = this._getThumbPosition();\r\n context.fillStyle = this._getBackgroundColor(context);\r\n\r\n context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n\r\n // Value bar\r\n context.fillStyle = this._getColor(context);\r\n\r\n // Thumb\r\n if (this.isVertical) {\r\n this._tempMeasure.left = left - this._effectiveBarOffset;\r\n this._tempMeasure.top = this._currentMeasure.top + thumbPosition;\r\n this._tempMeasure.width = this._currentMeasure.width;\r\n this._tempMeasure.height = this._effectiveThumbThickness;\r\n } else {\r\n this._tempMeasure.left = this._currentMeasure.left + thumbPosition;\r\n this._tempMeasure.top = this._currentMeasure.top;\r\n this._tempMeasure.width = this._effectiveThumbThickness;\r\n this._tempMeasure.height = this._currentMeasure.height;\r\n }\r\n\r\n context.fillRect(this._tempMeasure.left, this._tempMeasure.top, this._tempMeasure.width, this._tempMeasure.height);\r\n\r\n context.restore();\r\n }\r\n\r\n private _first: boolean;\r\n private _originX: number;\r\n private _originY: number;\r\n\r\n /**\r\n * @internal\r\n */\r\n protected override _updateValueFromPointer(x: number, y: number): void {\r\n if (this.rotation != 0) {\r\n this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition);\r\n x = this._transformedPosition.x;\r\n y = this._transformedPosition.y;\r\n }\r\n\r\n const sign = this._invertScrollDirection ? -1 : 1;\r\n\r\n if (this._first) {\r\n this._first = false;\r\n this._originX = x;\r\n this._originY = y;\r\n\r\n // Check if move is required\r\n if (\r\n x < this._tempMeasure.left ||\r\n x > this._tempMeasure.left + this._tempMeasure.width ||\r\n y < this._tempMeasure.top ||\r\n y > this._tempMeasure.top + this._tempMeasure.height\r\n ) {\r\n if (this.isVertical) {\r\n this.value = this.minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this.maximum - this.minimum);\r\n } else {\r\n this.value = this.minimum + ((x - this._currentMeasure.left) / this._currentMeasure.width) * (this.maximum - this.minimum);\r\n }\r\n }\r\n }\r\n\r\n // Delta mode\r\n let delta = 0;\r\n if (this.isVertical) {\r\n delta = -((y - this._originY) / (this._currentMeasure.height - this._effectiveThumbThickness));\r\n } else {\r\n delta = (x - this._originX) / (this._currentMeasure.width - this._effectiveThumbThickness);\r\n }\r\n\r\n this.value += sign * delta * (this.maximum - this.minimum);\r\n\r\n this._originX = x;\r\n this._originY = y;\r\n }\r\n\r\n public override _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean {\r\n this._first = true;\r\n\r\n return super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi);\r\n }\r\n\r\n public override serialize(serializationObject: any) {\r\n super.serialize(serializationObject);\r\n\r\n if (this.backgroundGradient) {\r\n serializationObject.backgroundGradient = {};\r\n this.backgroundGradient.serialize(serializationObject.backgroundGradient);\r\n }\r\n }\r\n\r\n public override _parseFromContent(serializationObject: any, host: AdvancedDynamicTexture) {\r\n super._parseFromContent(serializationObject, host);\r\n\r\n if (serializationObject.backgroundGradient) {\r\n const className = Tools.Instantiate(\"BABYLON.GUI.\" + serializationObject.backgroundGradient.className);\r\n this.backgroundGradient = new className();\r\n this.backgroundGradient!.parse(serializationObject.backgroundGradient);\r\n }\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.Scrollbar\", ScrollBar);\r\n"]}
1
+ {"version":3,"file":"scrollBar.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/2D/controls/sliders/scrollBar.ts"],"names":[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CAAC;IAEe,SAAS,CAAC,mBAAwB;QAC9C,KAAK,CAAC,SAAS,CAAC,mBAAmB,CAAC,CAAC;QAErC,IAAI,IAAI,CAAC,kBAAkB,EAAE,CAAC;YAC1B,mBAAmB,CAAC,kBAAkB,GAAG,EAAE,CAAC;YAC5C,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;QAC9E,CAAC;IACL,CAAC;IAEe,iBAAiB,CAAC,mBAAwB,EAAE,IAA4B;QACpF,KAAK,CAAC,iBAAiB,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC;QAEnD,IAAI,mBAAmB,CAAC,kBAAkB,EAAE,CAAC;YACzC,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,CAAC,cAAc,GAAG,mBAAmB,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;YACvG,IAAI,CAAC,kBAAkB,GAAG,IAAI,SAAS,EAAE,CAAC;YAC1C,IAAI,CAAC,kBAAmB,CAAC,KAAK,CAAC,mBAAmB,CAAC,kBAAkB,CAAC,CAAC;QAC3E,CAAC;IACL,CAAC;CACJ;AAzLG;IADC,SAAS,EAAE;4CAGX;AAaD;IADC,SAAS,EAAE;2CAGX;AA2BD;IADC,SAAS,EAAE;sDAGX;AA4IL,aAAa,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC","sourcesContent":["import type { Vector2 } from \"core/Maths/math.vector\";\r\nimport { BaseSlider } from \"./baseSlider\";\r\nimport type { Control } from \"../control\";\r\nimport { Measure } from \"../../measure\";\r\nimport type { PointerInfoBase } from \"core/Events/pointerEvents\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\nimport type { ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\nimport type { Nullable } from \"core/types\";\r\nimport type { BaseGradient } from \"../gradient/BaseGradient\";\r\nimport type { AdvancedDynamicTexture } from \"gui/2D/advancedDynamicTexture\";\r\nimport { Tools } from \"core/Misc/tools\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\n\r\n/**\r\n * Class used to create slider controls\r\n */\r\nexport class ScrollBar extends BaseSlider {\r\n private _background = \"black\";\r\n private _borderColor = \"white\";\r\n private _tempMeasure = new Measure(0, 0, 0, 0);\r\n private _invertScrollDirection = false;\r\n private _backgroundGradient: Nullable<BaseGradient> = null;\r\n\r\n /** Gets or sets border color */\r\n @serialize()\r\n public get borderColor(): string {\r\n return this._borderColor;\r\n }\r\n\r\n public set borderColor(value: string) {\r\n if (this._borderColor === value) {\r\n return;\r\n }\r\n\r\n this._borderColor = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets background color */\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 background gradient. Takes precedence over gradient. */\r\n public get backgroundGradient(): Nullable<BaseGradient> {\r\n return this._backgroundGradient;\r\n }\r\n\r\n public set backgroundGradient(value: Nullable<BaseGradient>) {\r\n if (this._backgroundGradient === value) {\r\n return;\r\n }\r\n\r\n this._backgroundGradient = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Inverts the scrolling direction (default: false) */\r\n @serialize()\r\n public get invertScrollDirection() {\r\n return this._invertScrollDirection;\r\n }\r\n\r\n public set invertScrollDirection(invert: boolean) {\r\n this._invertScrollDirection = invert;\r\n }\r\n\r\n /**\r\n * Creates a new Slider\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 \"Scrollbar\";\r\n }\r\n\r\n protected override _getThumbThickness(): number {\r\n let thumbThickness = 0;\r\n if (this._thumbWidth.isPixel) {\r\n thumbThickness = this._thumbWidth.getValue(this._host);\r\n } else {\r\n thumbThickness = this._backgroundBoxThickness * this._thumbWidth.getValue(this._host);\r\n }\r\n return thumbThickness;\r\n }\r\n\r\n private _getBackgroundColor(context: ICanvasRenderingContext) {\r\n return this._backgroundGradient ? this._backgroundGradient.getCanvasGradient(context) : this._background;\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 this._prepareRenderingData(\"rectangle\");\r\n const left = this._renderLeft;\r\n\r\n const thumbPosition = this._getThumbPosition();\r\n context.fillStyle = this._getBackgroundColor(context);\r\n\r\n context.fillRect(this._currentMeasure.left, this._currentMeasure.top, this._currentMeasure.width, this._currentMeasure.height);\r\n\r\n // Value bar\r\n context.fillStyle = this._getColor(context);\r\n\r\n // Thumb\r\n if (this.isVertical) {\r\n this._tempMeasure.left = left - this._effectiveBarOffset;\r\n this._tempMeasure.top = this._currentMeasure.top + thumbPosition;\r\n this._tempMeasure.width = this._currentMeasure.width;\r\n this._tempMeasure.height = this._effectiveThumbThickness;\r\n } else {\r\n this._tempMeasure.left = this._currentMeasure.left + thumbPosition;\r\n this._tempMeasure.top = this._currentMeasure.top;\r\n this._tempMeasure.width = this._effectiveThumbThickness;\r\n this._tempMeasure.height = this._currentMeasure.height;\r\n }\r\n\r\n context.fillRect(this._tempMeasure.left, this._tempMeasure.top, this._tempMeasure.width, this._tempMeasure.height);\r\n\r\n context.restore();\r\n }\r\n\r\n private _first: boolean;\r\n private _originX: number;\r\n private _originY: number;\r\n\r\n /**\r\n * @internal\r\n */\r\n protected override _updateValueFromPointer(x: number, y: number): void {\r\n if (this.rotation != 0) {\r\n this._invertTransformMatrix.transformCoordinates(x, y, this._transformedPosition);\r\n x = this._transformedPosition.x;\r\n y = this._transformedPosition.y;\r\n }\r\n\r\n const sign = this._invertScrollDirection ? -1 : 1;\r\n\r\n if (this._first) {\r\n this._first = false;\r\n this._originX = x;\r\n this._originY = y;\r\n\r\n // Check if move is required\r\n if (\r\n x < this._tempMeasure.left ||\r\n x > this._tempMeasure.left + this._tempMeasure.width ||\r\n y < this._tempMeasure.top ||\r\n y > this._tempMeasure.top + this._tempMeasure.height\r\n ) {\r\n if (this.isVertical) {\r\n this.value = this.minimum + (1 - (y - this._currentMeasure.top) / this._currentMeasure.height) * (this.maximum - this.minimum);\r\n } else {\r\n this.value = this.minimum + ((x - this._currentMeasure.left) / this._currentMeasure.width) * (this.maximum - this.minimum);\r\n }\r\n }\r\n }\r\n\r\n // Delta mode\r\n let delta = 0;\r\n if (this.isVertical) {\r\n delta = -((y - this._originY) / (this._currentMeasure.height - this._effectiveThumbThickness));\r\n } else {\r\n delta = (x - this._originX) / (this._currentMeasure.width - this._effectiveThumbThickness);\r\n }\r\n\r\n this.value += sign * delta * (this.maximum - this.minimum);\r\n\r\n this._originX = x;\r\n this._originY = y;\r\n }\r\n\r\n public override _onPointerDown(target: Control, coordinates: Vector2, pointerId: number, buttonIndex: number, pi: PointerInfoBase): boolean {\r\n this._first = true;\r\n\r\n return super._onPointerDown(target, coordinates, pointerId, buttonIndex, pi);\r\n }\r\n\r\n public override serialize(serializationObject: any) {\r\n super.serialize(serializationObject);\r\n\r\n if (this.backgroundGradient) {\r\n serializationObject.backgroundGradient = {};\r\n this.backgroundGradient.serialize(serializationObject.backgroundGradient);\r\n }\r\n }\r\n\r\n public override _parseFromContent(serializationObject: any, host: AdvancedDynamicTexture) {\r\n super._parseFromContent(serializationObject, host);\r\n\r\n if (serializationObject.backgroundGradient) {\r\n const className = Tools.Instantiate(\"BABYLON.GUI.\" + serializationObject.backgroundGradient.className);\r\n this.backgroundGradient = new className();\r\n this.backgroundGradient!.parse(serializationObject.backgroundGradient);\r\n }\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.Scrollbar\", ScrollBar);\r\n"]}