@babylonjs/gui 7.1.0 → 7.2.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -172,6 +172,7 @@ export class ScrollViewer extends Rectangle {
|
|
172
172
|
this._dragSpace = new Rectangle();
|
173
173
|
this._dragSpace.thickness = 1;
|
174
174
|
this._grid.addControl(this._dragSpace, 1, 1);
|
175
|
+
this._grid.clipChildren = false;
|
175
176
|
// Colors
|
176
177
|
if (!this._useImageBar) {
|
177
178
|
this.barColor = "grey";
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"scrollViewer.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/2D/controls/scrollViewers/scrollViewer.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAIrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAEpD,OAAO,EAAE,SAAS,EAAE,2CAA6B;AAEjD;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,SAAS;IA+BvC;;OAEG;IACH,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC;IAC7B,CAAC;IAED;;;;OAIG;IACI,UAAU,CAAC,OAA0B;QACxC,IAAI,CAAC,OAAO,EAAE;YACV,OAAO,IAAI,CAAC;SACf;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;QAEjC,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;;;OAIG;IACI,aAAa,CAAC,OAA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,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAExC,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE7C,OAAO,CAAC,OAAO,EAAE,CAAC;IACtB,CAAC;IAED,oCAAoC;IAC7B,OAAO;QACV,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACrD,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ;AA1aG;IADC,SAAS,EAAE;kDAGX;AAoBD;IADC,SAAS,EAAE;oDAGX;AAYD;IADC,SAAS,EAAE;4CAGX;AA6DD;IADC,SAAS,EAAE;2CAGX;AAmID;IADC,SAAS,EAAE;iDAGX;AAiML,aAAa,CAAC,0BAA0B,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport type { Vector2 } from \"core/Maths/math\";\r\nimport { Rectangle } from \"../rectangle\";\r\nimport { Grid } from \"../grid\";\r\nimport type { Image } from \"../image\";\r\nimport { Control } from \"../control\";\r\nimport type { Container } from \"../container\";\r\nimport type { Measure } from \"../../measure\";\r\nimport type { AdvancedDynamicTexture } from \"../../advancedDynamicTexture\";\r\nimport { _ScrollViewerWindow } from \"./scrollViewerWindow\";\r\nimport { ScrollBar } from \"../sliders/scrollBar\";\r\nimport { ImageScrollBar } from \"../sliders/imageScrollBar\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\n\r\n/**\r\n * Class used to hold a viewer window and sliders in a grid\r\n */\r\nexport class ScrollViewer extends Rectangle {\r\n private _grid: Grid;\r\n private _horizontalBarSpace: Rectangle;\r\n private _verticalBarSpace: Rectangle;\r\n private _dragSpace: Rectangle;\r\n private _horizontalBar: ScrollBar | ImageScrollBar;\r\n private _verticalBar: ScrollBar | ImageScrollBar;\r\n private _barColor: string;\r\n private _barBackground: string;\r\n private _barImage: Image;\r\n private _horizontalBarImage: Image;\r\n private _verticalBarImage: Image;\r\n private _barBackgroundImage: Image;\r\n private _horizontalBarBackgroundImage: Image;\r\n private _verticalBarBackgroundImage: Image;\r\n private _barSize: number = 20;\r\n private _window: _ScrollViewerWindow;\r\n private _pointerIsOver: Boolean = false;\r\n private _wheelPrecision: number = 0.05;\r\n private _onWheelObserver: Nullable<Observer<Vector2>>;\r\n private _clientWidth: number;\r\n private _clientHeight: number;\r\n private _useImageBar: Boolean;\r\n private _thumbLength: number = 0.5;\r\n private _thumbHeight: number = 1;\r\n private _barImageHeight: number = 1;\r\n private _horizontalBarImageHeight: number = 1;\r\n private _verticalBarImageHeight: number = 1;\r\n private _oldWindowContentsWidth: number = 0;\r\n private _oldWindowContentsHeight: number = 0;\r\n\r\n /**\r\n * Gets the horizontal scrollbar\r\n */\r\n public get horizontalBar(): ScrollBar | ImageScrollBar {\r\n return this._horizontalBar;\r\n }\r\n\r\n /**\r\n * Gets the vertical scrollbar\r\n */\r\n public get verticalBar(): ScrollBar | ImageScrollBar {\r\n return this._verticalBar;\r\n }\r\n\r\n /**\r\n * Adds a new control to the current container\r\n * @param control defines the control to add\r\n * @returns the current container\r\n */\r\n public addControl(control: Nullable<Control>): Container {\r\n if (!control) {\r\n return this;\r\n }\r\n\r\n this._window.addControl(control);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Removes a control from the current container\r\n * @param control defines the control to remove\r\n * @returns the current container\r\n */\r\n public removeControl(control: Control): Container {\r\n this._window.removeControl(control);\r\n return this;\r\n }\r\n\r\n /** Gets the list of children */\r\n public get children(): Control[] {\r\n return this._window.children;\r\n }\r\n\r\n public _flagDescendantsAsMatrixDirty(): void {\r\n for (const child of this._children) {\r\n child._markMatrixAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Freezes or unfreezes the controls in the window.\r\n * When controls are frozen, the scroll viewer can render a lot more quickly but updates to positions/sizes of controls\r\n * are not taken into account. If you want to change positions/sizes, unfreeze, perform the changes then freeze again\r\n */\r\n public get freezeControls(): boolean {\r\n return this._window.freezeControls;\r\n }\r\n\r\n public set freezeControls(value: boolean) {\r\n this._window.freezeControls = value;\r\n }\r\n\r\n /** Gets the bucket width */\r\n public get bucketWidth(): number {\r\n return this._window.bucketWidth;\r\n }\r\n\r\n /** Gets the bucket height */\r\n public get bucketHeight(): number {\r\n return this._window.bucketHeight;\r\n }\r\n\r\n /**\r\n * Sets the bucket sizes.\r\n * When freezeControls is true, setting a non-zero bucket size will improve performances by updating only\r\n * controls that are visible. The bucket sizes is used to subdivide (internally) the window area to smaller areas into which\r\n * controls are dispatched. So, the size should be roughly equals to the mean size of all the controls of\r\n * the window. To disable the usage of buckets, sets either width or height (or both) to 0.\r\n * Please note that using this option will raise the memory usage (the higher the bucket sizes, the less memory\r\n * used), that's why it is not enabled by default.\r\n * @param width width of the bucket\r\n * @param height height of the bucket\r\n */\r\n public setBucketSizes(width: number, height: number): void {\r\n this._window.setBucketSizes(width, height);\r\n }\r\n\r\n private _forceHorizontalBar: boolean = false;\r\n private _forceVerticalBar: boolean = false;\r\n\r\n /**\r\n * Forces the horizontal scroll bar to be displayed\r\n */\r\n public get forceHorizontalBar(): boolean {\r\n return this._forceHorizontalBar;\r\n }\r\n\r\n public set forceHorizontalBar(value: boolean) {\r\n this._grid.setRowDefinition(1, value ? this._barSize : 0, true);\r\n this._horizontalBar.isVisible = value;\r\n this._forceHorizontalBar = value;\r\n }\r\n\r\n /**\r\n * Forces the vertical scroll bar to be displayed\r\n */\r\n public get forceVerticalBar(): boolean {\r\n return this._forceVerticalBar;\r\n }\r\n\r\n public set forceVerticalBar(value: boolean) {\r\n this._grid.setColumnDefinition(1, value ? this._barSize : 0, true);\r\n this._verticalBar.isVisible = value;\r\n this._forceVerticalBar = value;\r\n }\r\n\r\n /**\r\n * Creates a new ScrollViewer\r\n * @param name of ScrollViewer\r\n * @param isImageBased\r\n */\r\n constructor(name?: string, isImageBased?: boolean) {\r\n super(name);\r\n\r\n this._useImageBar = isImageBased ? isImageBased : false;\r\n\r\n this.onDirtyObservable.add(() => {\r\n this._horizontalBarSpace.color = this.color;\r\n this._verticalBarSpace.color = this.color;\r\n this._dragSpace.color = this.color;\r\n });\r\n\r\n this.onPointerEnterObservable.add(() => {\r\n this._pointerIsOver = true;\r\n });\r\n\r\n this.onPointerOutObservable.add(() => {\r\n this._pointerIsOver = false;\r\n });\r\n\r\n this._grid = new Grid();\r\n if (this._useImageBar) {\r\n this._horizontalBar = new ImageScrollBar();\r\n this._verticalBar = new ImageScrollBar();\r\n } else {\r\n this._horizontalBar = new ScrollBar();\r\n this._verticalBar = new ScrollBar();\r\n }\r\n\r\n this._window = new _ScrollViewerWindow(\"scrollViewer_window\");\r\n this._window.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n this._window.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n\r\n this._grid.addColumnDefinition(1);\r\n this._grid.addColumnDefinition(0, true);\r\n this._grid.addRowDefinition(1);\r\n this._grid.addRowDefinition(0, true);\r\n\r\n super.addControl(this._grid);\r\n this._grid.addControl(this._window, 0, 0);\r\n\r\n this._verticalBarSpace = new Rectangle();\r\n this._verticalBarSpace.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n this._verticalBarSpace.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n this._verticalBarSpace.thickness = 1;\r\n this._grid.addControl(this._verticalBarSpace, 0, 1);\r\n this._addBar(this._verticalBar, this._verticalBarSpace, true, Math.PI);\r\n\r\n this._horizontalBarSpace = new Rectangle();\r\n this._horizontalBarSpace.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n this._horizontalBarSpace.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n this._horizontalBarSpace.thickness = 1;\r\n this._grid.addControl(this._horizontalBarSpace, 1, 0);\r\n this._addBar(this._horizontalBar, this._horizontalBarSpace, false, 0);\r\n\r\n this._dragSpace = new Rectangle();\r\n this._dragSpace.thickness = 1;\r\n this._grid.addControl(this._dragSpace, 1, 1);\r\n\r\n // Colors\r\n if (!this._useImageBar) {\r\n this.barColor = \"grey\";\r\n this.barBackground = \"transparent\";\r\n }\r\n }\r\n\r\n /** Reset the scroll viewer window to initial size */\r\n public resetWindow() {\r\n this._window.width = \"100%\";\r\n this._window.height = \"100%\";\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"ScrollViewer\";\r\n }\r\n\r\n private _buildClientSizes() {\r\n const ratio = this.host.idealRatio;\r\n\r\n this._window.parentClientWidth = this._currentMeasure.width - (this._verticalBar.isVisible || this.forceVerticalBar ? this._barSize * ratio : 0) - 2 * this.thickness;\r\n this._window.parentClientHeight = this._currentMeasure.height - (this._horizontalBar.isVisible || this.forceHorizontalBar ? this._barSize * ratio : 0) - 2 * this.thickness;\r\n\r\n this._clientWidth = this._window.parentClientWidth;\r\n this._clientHeight = this._window.parentClientHeight;\r\n }\r\n\r\n protected _additionalProcessing(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n super._additionalProcessing(parentMeasure, context);\r\n\r\n this._buildClientSizes();\r\n }\r\n\r\n protected _postMeasure(): void {\r\n super._postMeasure();\r\n\r\n this._updateScroller();\r\n\r\n this._setWindowPosition(false);\r\n }\r\n\r\n /**\r\n * Gets or sets the mouse wheel precision\r\n * from 0 to 1 with a default value of 0.05\r\n * */\r\n @serialize()\r\n public get wheelPrecision(): number {\r\n return this._wheelPrecision;\r\n }\r\n\r\n public set wheelPrecision(value: number) {\r\n if (this._wheelPrecision === value) {\r\n return;\r\n }\r\n\r\n if (value < 0) {\r\n value = 0;\r\n }\r\n\r\n if (value > 1) {\r\n value = 1;\r\n }\r\n\r\n this._wheelPrecision = value;\r\n }\r\n\r\n /** Gets or sets the scroll bar container background color */\r\n @serialize()\r\n public get scrollBackground(): string {\r\n return this._horizontalBarSpace.background;\r\n }\r\n\r\n public set scrollBackground(color: string) {\r\n if (this._horizontalBarSpace.background === color) {\r\n return;\r\n }\r\n this._horizontalBarSpace.background = color;\r\n this._verticalBarSpace.background = color;\r\n }\r\n\r\n /** Gets or sets the bar color */\r\n @serialize()\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._horizontalBar.color = color;\r\n this._verticalBar.color = color;\r\n }\r\n\r\n /** Gets or sets the bar image */\r\n public get thumbImage(): Image {\r\n return this._barImage;\r\n }\r\n\r\n public set thumbImage(value: Image) {\r\n if (this._barImage === value) {\r\n return;\r\n }\r\n\r\n this._barImage = value;\r\n const hb = <ImageScrollBar>this._horizontalBar;\r\n const vb = <ImageScrollBar>this._verticalBar;\r\n hb.thumbImage = value;\r\n vb.thumbImage = value;\r\n }\r\n\r\n /** Gets or sets the horizontal bar image */\r\n public get horizontalThumbImage(): Image {\r\n return this._horizontalBarImage;\r\n }\r\n\r\n public set horizontalThumbImage(value: Image) {\r\n if (this._horizontalBarImage === value) {\r\n return;\r\n }\r\n\r\n this._horizontalBarImage = value;\r\n const hb = <ImageScrollBar>this._horizontalBar;\r\n hb.thumbImage = value;\r\n }\r\n\r\n /** Gets or sets the vertical bar image */\r\n public get verticalThumbImage(): Image {\r\n return this._verticalBarImage;\r\n }\r\n\r\n public set verticalThumbImage(value: Image) {\r\n if (this._verticalBarImage === value) {\r\n return;\r\n }\r\n\r\n this._verticalBarImage = value;\r\n const vb = <ImageScrollBar>this._verticalBar;\r\n vb.thumbImage = value;\r\n }\r\n\r\n /** Gets or sets the size of the bar */\r\n @serialize()\r\n public get barSize(): number {\r\n return this._barSize;\r\n }\r\n\r\n public set barSize(value: number) {\r\n if (this._barSize === value) {\r\n return;\r\n }\r\n\r\n this._barSize = value;\r\n this._markAsDirty();\r\n\r\n if (this._horizontalBar.isVisible) {\r\n this._grid.setRowDefinition(1, this._barSize, true);\r\n }\r\n if (this._verticalBar.isVisible) {\r\n this._grid.setColumnDefinition(1, this._barSize, true);\r\n }\r\n }\r\n\r\n /** Gets or sets the length of the thumb */\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 if (value <= 0) {\r\n value = 0.1;\r\n }\r\n if (value > 1) {\r\n value = 1;\r\n }\r\n this._thumbLength = value;\r\n const hb = <ImageScrollBar>this._horizontalBar;\r\n const vb = <ImageScrollBar>this._verticalBar;\r\n hb.thumbLength = value;\r\n vb.thumbLength = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the height of the thumb */\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._thumbHeight === value) {\r\n return;\r\n }\r\n if (value <= 0) {\r\n value = 0.1;\r\n }\r\n if (value > 1) {\r\n value = 1;\r\n }\r\n this._thumbHeight = value;\r\n const hb = <ImageScrollBar>this._horizontalBar;\r\n const vb = <ImageScrollBar>this._verticalBar;\r\n hb.thumbHeight = value;\r\n vb.thumbHeight = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the height of the bar image */\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 if (value <= 0) {\r\n value = 0.1;\r\n }\r\n if (value > 1) {\r\n value = 1;\r\n }\r\n this._barImageHeight = value;\r\n const hb = <ImageScrollBar>this._horizontalBar;\r\n const vb = <ImageScrollBar>this._verticalBar;\r\n hb.barImageHeight = value;\r\n vb.barImageHeight = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the height of the horizontal bar image */\r\n public get horizontalBarImageHeight(): number {\r\n return this._horizontalBarImageHeight;\r\n }\r\n\r\n public set horizontalBarImageHeight(value: number) {\r\n if (this._horizontalBarImageHeight === value) {\r\n return;\r\n }\r\n if (value <= 0) {\r\n value = 0.1;\r\n }\r\n if (value > 1) {\r\n value = 1;\r\n }\r\n this._horizontalBarImageHeight = value;\r\n const hb = <ImageScrollBar>this._horizontalBar;\r\n hb.barImageHeight = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the height of the vertical bar image */\r\n public get verticalBarImageHeight(): number {\r\n return this._verticalBarImageHeight;\r\n }\r\n\r\n public set verticalBarImageHeight(value: number) {\r\n if (this._verticalBarImageHeight === value) {\r\n return;\r\n }\r\n if (value <= 0) {\r\n value = 0.1;\r\n }\r\n if (value > 1) {\r\n value = 1;\r\n }\r\n this._verticalBarImageHeight = value;\r\n const vb = <ImageScrollBar>this._verticalBar;\r\n vb.barImageHeight = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the bar background */\r\n @serialize()\r\n public get barBackground(): string {\r\n return this._barBackground;\r\n }\r\n\r\n public set barBackground(color: string) {\r\n if (this._barBackground === color) {\r\n return;\r\n }\r\n\r\n this._barBackground = color;\r\n const hb = <ScrollBar>this._horizontalBar;\r\n const vb = <ScrollBar>this._verticalBar;\r\n hb.background = color;\r\n vb.background = color;\r\n this._dragSpace.background = color;\r\n }\r\n\r\n /** Gets or sets the bar background image */\r\n public get barImage(): Image {\r\n return this._barBackgroundImage;\r\n }\r\n\r\n public set barImage(value: Image) {\r\n this._barBackgroundImage = value;\r\n const hb = <ImageScrollBar>this._horizontalBar;\r\n const vb = <ImageScrollBar>this._verticalBar;\r\n hb.backgroundImage = value;\r\n vb.backgroundImage = value;\r\n }\r\n\r\n /** Gets or sets the horizontal bar background image */\r\n public get horizontalBarImage(): Image {\r\n return this._horizontalBarBackgroundImage;\r\n }\r\n\r\n public set horizontalBarImage(value: Image) {\r\n this._horizontalBarBackgroundImage = value;\r\n const hb = <ImageScrollBar>this._horizontalBar;\r\n hb.backgroundImage = value;\r\n }\r\n\r\n /** Gets or sets the vertical bar background image */\r\n public get verticalBarImage(): Image {\r\n return this._verticalBarBackgroundImage;\r\n }\r\n\r\n public set verticalBarImage(value: Image) {\r\n this._verticalBarBackgroundImage = value;\r\n const vb = <ImageScrollBar>this._verticalBar;\r\n vb.backgroundImage = value;\r\n }\r\n\r\n private _setWindowPosition(force = true): void {\r\n const ratio = this.host.idealRatio;\r\n const windowContentsWidth = this._window._currentMeasure.width;\r\n const windowContentsHeight = this._window._currentMeasure.height;\r\n\r\n if (!force && this._oldWindowContentsWidth === windowContentsWidth && this._oldWindowContentsHeight === windowContentsHeight) {\r\n return;\r\n }\r\n\r\n this._oldWindowContentsWidth = windowContentsWidth;\r\n this._oldWindowContentsHeight = windowContentsHeight;\r\n\r\n const _endLeft = this._clientWidth - windowContentsWidth;\r\n const _endTop = this._clientHeight - windowContentsHeight;\r\n\r\n const newLeft = (this._horizontalBar.value / ratio) * _endLeft + \"px\";\r\n const newTop = (this._verticalBar.value / ratio) * _endTop + \"px\";\r\n\r\n if (newLeft !== this._window.left) {\r\n this._window.left = newLeft;\r\n if (!this.freezeControls) {\r\n this._rebuildLayout = true;\r\n }\r\n }\r\n\r\n if (newTop !== this._window.top) {\r\n this._window.top = newTop;\r\n if (!this.freezeControls) {\r\n this._rebuildLayout = true;\r\n }\r\n }\r\n }\r\n\r\n /** @internal */\r\n private _updateScroller(): void {\r\n const windowContentsWidth = this._window._currentMeasure.width;\r\n const windowContentsHeight = this._window._currentMeasure.height;\r\n\r\n if (this._horizontalBar.isVisible && windowContentsWidth <= this._clientWidth && !this.forceHorizontalBar) {\r\n this._grid.setRowDefinition(1, 0, true);\r\n this._horizontalBar.isVisible = false;\r\n this._horizontalBar.value = 0;\r\n this._rebuildLayout = true;\r\n } else if (!this._horizontalBar.isVisible && (windowContentsWidth > this._clientWidth || this.forceHorizontalBar)) {\r\n this._grid.setRowDefinition(1, this._barSize, true);\r\n this._horizontalBar.isVisible = true;\r\n this._rebuildLayout = true;\r\n }\r\n\r\n if (this._verticalBar.isVisible && windowContentsHeight <= this._clientHeight && !this.forceVerticalBar) {\r\n this._grid.setColumnDefinition(1, 0, true);\r\n this._verticalBar.isVisible = false;\r\n this._verticalBar.value = 0;\r\n this._rebuildLayout = true;\r\n } else if (!this._verticalBar.isVisible && (windowContentsHeight > this._clientHeight || this.forceVerticalBar)) {\r\n this._grid.setColumnDefinition(1, this._barSize, true);\r\n this._verticalBar.isVisible = true;\r\n this._rebuildLayout = true;\r\n }\r\n\r\n this._buildClientSizes();\r\n\r\n const ratio = this.host.idealRatio;\r\n\r\n this._horizontalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientWidth / ratio) + \"px\";\r\n this._verticalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientHeight / ratio) + \"px\";\r\n }\r\n\r\n public _link(host: AdvancedDynamicTexture): void {\r\n super._link(host);\r\n\r\n this._attachWheel();\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n private _addBar(barControl: ScrollBar | ImageScrollBar, barContainer: Rectangle, isVertical: boolean, rotation: number) {\r\n barControl.paddingLeft = 0;\r\n barControl.width = \"100%\";\r\n barControl.height = \"100%\";\r\n barControl.barOffset = 0;\r\n barControl.value = 0;\r\n barControl.maximum = 1;\r\n barControl.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;\r\n barControl.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n barControl.isVertical = isVertical;\r\n barControl.rotation = rotation;\r\n barControl.isVisible = false;\r\n\r\n barContainer.addControl(barControl);\r\n\r\n barControl.onValueChangedObservable.add(() => {\r\n this._setWindowPosition();\r\n });\r\n }\r\n\r\n /** @internal */\r\n private _attachWheel() {\r\n if (!this._host || this._onWheelObserver) {\r\n return;\r\n }\r\n\r\n this._onWheelObserver = this.onWheelObservable.add((pi) => {\r\n if (!this._pointerIsOver || this.isReadOnly) {\r\n return;\r\n }\r\n if (this._verticalBar.isVisible == true) {\r\n if (pi.y < 0 && this._verticalBar.value > 0) {\r\n this._verticalBar.value -= this._wheelPrecision;\r\n } else if (pi.y > 0 && this._verticalBar.value < this._verticalBar.maximum) {\r\n this._verticalBar.value += this._wheelPrecision;\r\n }\r\n }\r\n if (this._horizontalBar.isVisible == true) {\r\n if (pi.x < 0 && this._horizontalBar.value < this._horizontalBar.maximum) {\r\n this._horizontalBar.value += this._wheelPrecision;\r\n } else if (pi.x > 0 && this._horizontalBar.value > 0) {\r\n this._horizontalBar.value -= this._wheelPrecision;\r\n }\r\n }\r\n });\r\n }\r\n\r\n public _renderHighlightSpecific(context: ICanvasRenderingContext): void {\r\n if (!this.isHighlighted) {\r\n return;\r\n }\r\n\r\n super._renderHighlightSpecific(context);\r\n\r\n this._grid._renderHighlightSpecific(context);\r\n\r\n context.restore();\r\n }\r\n\r\n /** Releases associated resources */\r\n public dispose() {\r\n this.onWheelObservable.remove(this._onWheelObserver);\r\n this._onWheelObserver = null;\r\n super.dispose();\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.ScrollViewer\", ScrollViewer);\r\n"]}
|
1
|
+
{"version":3,"file":"scrollViewer.js","sourceRoot":"","sources":["../../../../../../dev/gui/src/2D/controls/scrollViewers/scrollViewer.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAE/B,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AAIrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,0CAA4B;AAEpD,OAAO,EAAE,SAAS,EAAE,2CAA6B;AAEjD;;GAEG;AACH,MAAM,OAAO,YAAa,SAAQ,SAAS;IA+BvC;;OAEG;IACH,IAAW,aAAa;QACpB,OAAO,IAAI,CAAC,cAA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IAAI,CAAC,cAAc,CAAC,KAAK,IAAI,IAAI,CAAC,eAAe,CAAC;iBACrD;qBAAM,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,KAAK,GAAG,CAAC,EAAE;oBAClD,IAAI,CAAC,cAAc,CAAC,KAAK,IAAI,IAAI,CAAC,eAAe,CAAC;iBACrD;aACJ;QACL,CAAC,CAAC,CAAC;IACP,CAAC;IAEM,wBAAwB,CAAC,OAAgC;QAC5D,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE;YACrB,OAAO;SACV;QAED,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAExC,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QAE7C,OAAO,CAAC,OAAO,EAAE,CAAC;IACtB,CAAC;IAED,oCAAoC;IAC7B,OAAO;QACV,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACrD,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC;QAC7B,KAAK,CAAC,OAAO,EAAE,CAAC;IACpB,CAAC;CACJ;AA1aG;IADC,SAAS,EAAE;kDAGX;AAoBD;IADC,SAAS,EAAE;oDAGX;AAYD;IADC,SAAS,EAAE;4CAGX;AA6DD;IADC,SAAS,EAAE;2CAGX;AAmID;IADC,SAAS,EAAE;iDAGX;AAiML,aAAa,CAAC,0BAA0B,EAAE,YAAY,CAAC,CAAC","sourcesContent":["import type { Nullable } from \"core/types\";\r\nimport type { Observer } from \"core/Misc/observable\";\r\nimport type { Vector2 } from \"core/Maths/math\";\r\nimport { Rectangle } from \"../rectangle\";\r\nimport { Grid } from \"../grid\";\r\nimport type { Image } from \"../image\";\r\nimport { Control } from \"../control\";\r\nimport type { Container } from \"../container\";\r\nimport type { Measure } from \"../../measure\";\r\nimport type { AdvancedDynamicTexture } from \"../../advancedDynamicTexture\";\r\nimport { _ScrollViewerWindow } from \"./scrollViewerWindow\";\r\nimport { ScrollBar } from \"../sliders/scrollBar\";\r\nimport { ImageScrollBar } from \"../sliders/imageScrollBar\";\r\nimport { RegisterClass } from \"core/Misc/typeStore\";\r\nimport type { ICanvasRenderingContext } from \"core/Engines/ICanvas\";\r\nimport { serialize } from \"core/Misc/decorators\";\r\n\r\n/**\r\n * Class used to hold a viewer window and sliders in a grid\r\n */\r\nexport class ScrollViewer extends Rectangle {\r\n private _grid: Grid;\r\n private _horizontalBarSpace: Rectangle;\r\n private _verticalBarSpace: Rectangle;\r\n private _dragSpace: Rectangle;\r\n private _horizontalBar: ScrollBar | ImageScrollBar;\r\n private _verticalBar: ScrollBar | ImageScrollBar;\r\n private _barColor: string;\r\n private _barBackground: string;\r\n private _barImage: Image;\r\n private _horizontalBarImage: Image;\r\n private _verticalBarImage: Image;\r\n private _barBackgroundImage: Image;\r\n private _horizontalBarBackgroundImage: Image;\r\n private _verticalBarBackgroundImage: Image;\r\n private _barSize: number = 20;\r\n private _window: _ScrollViewerWindow;\r\n private _pointerIsOver: Boolean = false;\r\n private _wheelPrecision: number = 0.05;\r\n private _onWheelObserver: Nullable<Observer<Vector2>>;\r\n private _clientWidth: number;\r\n private _clientHeight: number;\r\n private _useImageBar: Boolean;\r\n private _thumbLength: number = 0.5;\r\n private _thumbHeight: number = 1;\r\n private _barImageHeight: number = 1;\r\n private _horizontalBarImageHeight: number = 1;\r\n private _verticalBarImageHeight: number = 1;\r\n private _oldWindowContentsWidth: number = 0;\r\n private _oldWindowContentsHeight: number = 0;\r\n\r\n /**\r\n * Gets the horizontal scrollbar\r\n */\r\n public get horizontalBar(): ScrollBar | ImageScrollBar {\r\n return this._horizontalBar;\r\n }\r\n\r\n /**\r\n * Gets the vertical scrollbar\r\n */\r\n public get verticalBar(): ScrollBar | ImageScrollBar {\r\n return this._verticalBar;\r\n }\r\n\r\n /**\r\n * Adds a new control to the current container\r\n * @param control defines the control to add\r\n * @returns the current container\r\n */\r\n public addControl(control: Nullable<Control>): Container {\r\n if (!control) {\r\n return this;\r\n }\r\n\r\n this._window.addControl(control);\r\n\r\n return this;\r\n }\r\n\r\n /**\r\n * Removes a control from the current container\r\n * @param control defines the control to remove\r\n * @returns the current container\r\n */\r\n public removeControl(control: Control): Container {\r\n this._window.removeControl(control);\r\n return this;\r\n }\r\n\r\n /** Gets the list of children */\r\n public get children(): Control[] {\r\n return this._window.children;\r\n }\r\n\r\n public _flagDescendantsAsMatrixDirty(): void {\r\n for (const child of this._children) {\r\n child._markMatrixAsDirty();\r\n }\r\n }\r\n\r\n /**\r\n * Freezes or unfreezes the controls in the window.\r\n * When controls are frozen, the scroll viewer can render a lot more quickly but updates to positions/sizes of controls\r\n * are not taken into account. If you want to change positions/sizes, unfreeze, perform the changes then freeze again\r\n */\r\n public get freezeControls(): boolean {\r\n return this._window.freezeControls;\r\n }\r\n\r\n public set freezeControls(value: boolean) {\r\n this._window.freezeControls = value;\r\n }\r\n\r\n /** Gets the bucket width */\r\n public get bucketWidth(): number {\r\n return this._window.bucketWidth;\r\n }\r\n\r\n /** Gets the bucket height */\r\n public get bucketHeight(): number {\r\n return this._window.bucketHeight;\r\n }\r\n\r\n /**\r\n * Sets the bucket sizes.\r\n * When freezeControls is true, setting a non-zero bucket size will improve performances by updating only\r\n * controls that are visible. The bucket sizes is used to subdivide (internally) the window area to smaller areas into which\r\n * controls are dispatched. So, the size should be roughly equals to the mean size of all the controls of\r\n * the window. To disable the usage of buckets, sets either width or height (or both) to 0.\r\n * Please note that using this option will raise the memory usage (the higher the bucket sizes, the less memory\r\n * used), that's why it is not enabled by default.\r\n * @param width width of the bucket\r\n * @param height height of the bucket\r\n */\r\n public setBucketSizes(width: number, height: number): void {\r\n this._window.setBucketSizes(width, height);\r\n }\r\n\r\n private _forceHorizontalBar: boolean = false;\r\n private _forceVerticalBar: boolean = false;\r\n\r\n /**\r\n * Forces the horizontal scroll bar to be displayed\r\n */\r\n public get forceHorizontalBar(): boolean {\r\n return this._forceHorizontalBar;\r\n }\r\n\r\n public set forceHorizontalBar(value: boolean) {\r\n this._grid.setRowDefinition(1, value ? this._barSize : 0, true);\r\n this._horizontalBar.isVisible = value;\r\n this._forceHorizontalBar = value;\r\n }\r\n\r\n /**\r\n * Forces the vertical scroll bar to be displayed\r\n */\r\n public get forceVerticalBar(): boolean {\r\n return this._forceVerticalBar;\r\n }\r\n\r\n public set forceVerticalBar(value: boolean) {\r\n this._grid.setColumnDefinition(1, value ? this._barSize : 0, true);\r\n this._verticalBar.isVisible = value;\r\n this._forceVerticalBar = value;\r\n }\r\n\r\n /**\r\n * Creates a new ScrollViewer\r\n * @param name of ScrollViewer\r\n * @param isImageBased\r\n */\r\n constructor(name?: string, isImageBased?: boolean) {\r\n super(name);\r\n\r\n this._useImageBar = isImageBased ? isImageBased : false;\r\n\r\n this.onDirtyObservable.add(() => {\r\n this._horizontalBarSpace.color = this.color;\r\n this._verticalBarSpace.color = this.color;\r\n this._dragSpace.color = this.color;\r\n });\r\n\r\n this.onPointerEnterObservable.add(() => {\r\n this._pointerIsOver = true;\r\n });\r\n\r\n this.onPointerOutObservable.add(() => {\r\n this._pointerIsOver = false;\r\n });\r\n\r\n this._grid = new Grid();\r\n if (this._useImageBar) {\r\n this._horizontalBar = new ImageScrollBar();\r\n this._verticalBar = new ImageScrollBar();\r\n } else {\r\n this._horizontalBar = new ScrollBar();\r\n this._verticalBar = new ScrollBar();\r\n }\r\n\r\n this._window = new _ScrollViewerWindow(\"scrollViewer_window\");\r\n this._window.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n this._window.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n\r\n this._grid.addColumnDefinition(1);\r\n this._grid.addColumnDefinition(0, true);\r\n this._grid.addRowDefinition(1);\r\n this._grid.addRowDefinition(0, true);\r\n\r\n super.addControl(this._grid);\r\n this._grid.addControl(this._window, 0, 0);\r\n\r\n this._verticalBarSpace = new Rectangle();\r\n this._verticalBarSpace.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n this._verticalBarSpace.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n this._verticalBarSpace.thickness = 1;\r\n this._grid.addControl(this._verticalBarSpace, 0, 1);\r\n this._addBar(this._verticalBar, this._verticalBarSpace, true, Math.PI);\r\n\r\n this._horizontalBarSpace = new Rectangle();\r\n this._horizontalBarSpace.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;\r\n this._horizontalBarSpace.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;\r\n this._horizontalBarSpace.thickness = 1;\r\n this._grid.addControl(this._horizontalBarSpace, 1, 0);\r\n this._addBar(this._horizontalBar, this._horizontalBarSpace, false, 0);\r\n\r\n this._dragSpace = new Rectangle();\r\n this._dragSpace.thickness = 1;\r\n this._grid.addControl(this._dragSpace, 1, 1);\r\n\r\n this._grid.clipChildren = false;\r\n\r\n // Colors\r\n if (!this._useImageBar) {\r\n this.barColor = \"grey\";\r\n this.barBackground = \"transparent\";\r\n }\r\n }\r\n\r\n /** Reset the scroll viewer window to initial size */\r\n public resetWindow() {\r\n this._window.width = \"100%\";\r\n this._window.height = \"100%\";\r\n }\r\n\r\n protected _getTypeName(): string {\r\n return \"ScrollViewer\";\r\n }\r\n\r\n private _buildClientSizes() {\r\n const ratio = this.host.idealRatio;\r\n\r\n this._window.parentClientWidth = this._currentMeasure.width - (this._verticalBar.isVisible || this.forceVerticalBar ? this._barSize * ratio : 0) - 2 * this.thickness;\r\n this._window.parentClientHeight = this._currentMeasure.height - (this._horizontalBar.isVisible || this.forceHorizontalBar ? this._barSize * ratio : 0) - 2 * this.thickness;\r\n\r\n this._clientWidth = this._window.parentClientWidth;\r\n this._clientHeight = this._window.parentClientHeight;\r\n }\r\n\r\n protected _additionalProcessing(parentMeasure: Measure, context: ICanvasRenderingContext): void {\r\n super._additionalProcessing(parentMeasure, context);\r\n\r\n this._buildClientSizes();\r\n }\r\n\r\n protected _postMeasure(): void {\r\n super._postMeasure();\r\n\r\n this._updateScroller();\r\n\r\n this._setWindowPosition(false);\r\n }\r\n\r\n /**\r\n * Gets or sets the mouse wheel precision\r\n * from 0 to 1 with a default value of 0.05\r\n * */\r\n @serialize()\r\n public get wheelPrecision(): number {\r\n return this._wheelPrecision;\r\n }\r\n\r\n public set wheelPrecision(value: number) {\r\n if (this._wheelPrecision === value) {\r\n return;\r\n }\r\n\r\n if (value < 0) {\r\n value = 0;\r\n }\r\n\r\n if (value > 1) {\r\n value = 1;\r\n }\r\n\r\n this._wheelPrecision = value;\r\n }\r\n\r\n /** Gets or sets the scroll bar container background color */\r\n @serialize()\r\n public get scrollBackground(): string {\r\n return this._horizontalBarSpace.background;\r\n }\r\n\r\n public set scrollBackground(color: string) {\r\n if (this._horizontalBarSpace.background === color) {\r\n return;\r\n }\r\n this._horizontalBarSpace.background = color;\r\n this._verticalBarSpace.background = color;\r\n }\r\n\r\n /** Gets or sets the bar color */\r\n @serialize()\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._horizontalBar.color = color;\r\n this._verticalBar.color = color;\r\n }\r\n\r\n /** Gets or sets the bar image */\r\n public get thumbImage(): Image {\r\n return this._barImage;\r\n }\r\n\r\n public set thumbImage(value: Image) {\r\n if (this._barImage === value) {\r\n return;\r\n }\r\n\r\n this._barImage = value;\r\n const hb = <ImageScrollBar>this._horizontalBar;\r\n const vb = <ImageScrollBar>this._verticalBar;\r\n hb.thumbImage = value;\r\n vb.thumbImage = value;\r\n }\r\n\r\n /** Gets or sets the horizontal bar image */\r\n public get horizontalThumbImage(): Image {\r\n return this._horizontalBarImage;\r\n }\r\n\r\n public set horizontalThumbImage(value: Image) {\r\n if (this._horizontalBarImage === value) {\r\n return;\r\n }\r\n\r\n this._horizontalBarImage = value;\r\n const hb = <ImageScrollBar>this._horizontalBar;\r\n hb.thumbImage = value;\r\n }\r\n\r\n /** Gets or sets the vertical bar image */\r\n public get verticalThumbImage(): Image {\r\n return this._verticalBarImage;\r\n }\r\n\r\n public set verticalThumbImage(value: Image) {\r\n if (this._verticalBarImage === value) {\r\n return;\r\n }\r\n\r\n this._verticalBarImage = value;\r\n const vb = <ImageScrollBar>this._verticalBar;\r\n vb.thumbImage = value;\r\n }\r\n\r\n /** Gets or sets the size of the bar */\r\n @serialize()\r\n public get barSize(): number {\r\n return this._barSize;\r\n }\r\n\r\n public set barSize(value: number) {\r\n if (this._barSize === value) {\r\n return;\r\n }\r\n\r\n this._barSize = value;\r\n this._markAsDirty();\r\n\r\n if (this._horizontalBar.isVisible) {\r\n this._grid.setRowDefinition(1, this._barSize, true);\r\n }\r\n if (this._verticalBar.isVisible) {\r\n this._grid.setColumnDefinition(1, this._barSize, true);\r\n }\r\n }\r\n\r\n /** Gets or sets the length of the thumb */\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 if (value <= 0) {\r\n value = 0.1;\r\n }\r\n if (value > 1) {\r\n value = 1;\r\n }\r\n this._thumbLength = value;\r\n const hb = <ImageScrollBar>this._horizontalBar;\r\n const vb = <ImageScrollBar>this._verticalBar;\r\n hb.thumbLength = value;\r\n vb.thumbLength = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the height of the thumb */\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._thumbHeight === value) {\r\n return;\r\n }\r\n if (value <= 0) {\r\n value = 0.1;\r\n }\r\n if (value > 1) {\r\n value = 1;\r\n }\r\n this._thumbHeight = value;\r\n const hb = <ImageScrollBar>this._horizontalBar;\r\n const vb = <ImageScrollBar>this._verticalBar;\r\n hb.thumbHeight = value;\r\n vb.thumbHeight = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the height of the bar image */\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 if (value <= 0) {\r\n value = 0.1;\r\n }\r\n if (value > 1) {\r\n value = 1;\r\n }\r\n this._barImageHeight = value;\r\n const hb = <ImageScrollBar>this._horizontalBar;\r\n const vb = <ImageScrollBar>this._verticalBar;\r\n hb.barImageHeight = value;\r\n vb.barImageHeight = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the height of the horizontal bar image */\r\n public get horizontalBarImageHeight(): number {\r\n return this._horizontalBarImageHeight;\r\n }\r\n\r\n public set horizontalBarImageHeight(value: number) {\r\n if (this._horizontalBarImageHeight === value) {\r\n return;\r\n }\r\n if (value <= 0) {\r\n value = 0.1;\r\n }\r\n if (value > 1) {\r\n value = 1;\r\n }\r\n this._horizontalBarImageHeight = value;\r\n const hb = <ImageScrollBar>this._horizontalBar;\r\n hb.barImageHeight = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the height of the vertical bar image */\r\n public get verticalBarImageHeight(): number {\r\n return this._verticalBarImageHeight;\r\n }\r\n\r\n public set verticalBarImageHeight(value: number) {\r\n if (this._verticalBarImageHeight === value) {\r\n return;\r\n }\r\n if (value <= 0) {\r\n value = 0.1;\r\n }\r\n if (value > 1) {\r\n value = 1;\r\n }\r\n this._verticalBarImageHeight = value;\r\n const vb = <ImageScrollBar>this._verticalBar;\r\n vb.barImageHeight = value;\r\n this._markAsDirty();\r\n }\r\n\r\n /** Gets or sets the bar background */\r\n @serialize()\r\n public get barBackground(): string {\r\n return this._barBackground;\r\n }\r\n\r\n public set barBackground(color: string) {\r\n if (this._barBackground === color) {\r\n return;\r\n }\r\n\r\n this._barBackground = color;\r\n const hb = <ScrollBar>this._horizontalBar;\r\n const vb = <ScrollBar>this._verticalBar;\r\n hb.background = color;\r\n vb.background = color;\r\n this._dragSpace.background = color;\r\n }\r\n\r\n /** Gets or sets the bar background image */\r\n public get barImage(): Image {\r\n return this._barBackgroundImage;\r\n }\r\n\r\n public set barImage(value: Image) {\r\n this._barBackgroundImage = value;\r\n const hb = <ImageScrollBar>this._horizontalBar;\r\n const vb = <ImageScrollBar>this._verticalBar;\r\n hb.backgroundImage = value;\r\n vb.backgroundImage = value;\r\n }\r\n\r\n /** Gets or sets the horizontal bar background image */\r\n public get horizontalBarImage(): Image {\r\n return this._horizontalBarBackgroundImage;\r\n }\r\n\r\n public set horizontalBarImage(value: Image) {\r\n this._horizontalBarBackgroundImage = value;\r\n const hb = <ImageScrollBar>this._horizontalBar;\r\n hb.backgroundImage = value;\r\n }\r\n\r\n /** Gets or sets the vertical bar background image */\r\n public get verticalBarImage(): Image {\r\n return this._verticalBarBackgroundImage;\r\n }\r\n\r\n public set verticalBarImage(value: Image) {\r\n this._verticalBarBackgroundImage = value;\r\n const vb = <ImageScrollBar>this._verticalBar;\r\n vb.backgroundImage = value;\r\n }\r\n\r\n private _setWindowPosition(force = true): void {\r\n const ratio = this.host.idealRatio;\r\n const windowContentsWidth = this._window._currentMeasure.width;\r\n const windowContentsHeight = this._window._currentMeasure.height;\r\n\r\n if (!force && this._oldWindowContentsWidth === windowContentsWidth && this._oldWindowContentsHeight === windowContentsHeight) {\r\n return;\r\n }\r\n\r\n this._oldWindowContentsWidth = windowContentsWidth;\r\n this._oldWindowContentsHeight = windowContentsHeight;\r\n\r\n const _endLeft = this._clientWidth - windowContentsWidth;\r\n const _endTop = this._clientHeight - windowContentsHeight;\r\n\r\n const newLeft = (this._horizontalBar.value / ratio) * _endLeft + \"px\";\r\n const newTop = (this._verticalBar.value / ratio) * _endTop + \"px\";\r\n\r\n if (newLeft !== this._window.left) {\r\n this._window.left = newLeft;\r\n if (!this.freezeControls) {\r\n this._rebuildLayout = true;\r\n }\r\n }\r\n\r\n if (newTop !== this._window.top) {\r\n this._window.top = newTop;\r\n if (!this.freezeControls) {\r\n this._rebuildLayout = true;\r\n }\r\n }\r\n }\r\n\r\n /** @internal */\r\n private _updateScroller(): void {\r\n const windowContentsWidth = this._window._currentMeasure.width;\r\n const windowContentsHeight = this._window._currentMeasure.height;\r\n\r\n if (this._horizontalBar.isVisible && windowContentsWidth <= this._clientWidth && !this.forceHorizontalBar) {\r\n this._grid.setRowDefinition(1, 0, true);\r\n this._horizontalBar.isVisible = false;\r\n this._horizontalBar.value = 0;\r\n this._rebuildLayout = true;\r\n } else if (!this._horizontalBar.isVisible && (windowContentsWidth > this._clientWidth || this.forceHorizontalBar)) {\r\n this._grid.setRowDefinition(1, this._barSize, true);\r\n this._horizontalBar.isVisible = true;\r\n this._rebuildLayout = true;\r\n }\r\n\r\n if (this._verticalBar.isVisible && windowContentsHeight <= this._clientHeight && !this.forceVerticalBar) {\r\n this._grid.setColumnDefinition(1, 0, true);\r\n this._verticalBar.isVisible = false;\r\n this._verticalBar.value = 0;\r\n this._rebuildLayout = true;\r\n } else if (!this._verticalBar.isVisible && (windowContentsHeight > this._clientHeight || this.forceVerticalBar)) {\r\n this._grid.setColumnDefinition(1, this._barSize, true);\r\n this._verticalBar.isVisible = true;\r\n this._rebuildLayout = true;\r\n }\r\n\r\n this._buildClientSizes();\r\n\r\n const ratio = this.host.idealRatio;\r\n\r\n this._horizontalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientWidth / ratio) + \"px\";\r\n this._verticalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientHeight / ratio) + \"px\";\r\n }\r\n\r\n public _link(host: AdvancedDynamicTexture): void {\r\n super._link(host);\r\n\r\n this._attachWheel();\r\n }\r\n\r\n /**\r\n * @internal\r\n */\r\n private _addBar(barControl: ScrollBar | ImageScrollBar, barContainer: Rectangle, isVertical: boolean, rotation: number) {\r\n barControl.paddingLeft = 0;\r\n barControl.width = \"100%\";\r\n barControl.height = \"100%\";\r\n barControl.barOffset = 0;\r\n barControl.value = 0;\r\n barControl.maximum = 1;\r\n barControl.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_CENTER;\r\n barControl.verticalAlignment = Control.VERTICAL_ALIGNMENT_CENTER;\r\n barControl.isVertical = isVertical;\r\n barControl.rotation = rotation;\r\n barControl.isVisible = false;\r\n\r\n barContainer.addControl(barControl);\r\n\r\n barControl.onValueChangedObservable.add(() => {\r\n this._setWindowPosition();\r\n });\r\n }\r\n\r\n /** @internal */\r\n private _attachWheel() {\r\n if (!this._host || this._onWheelObserver) {\r\n return;\r\n }\r\n\r\n this._onWheelObserver = this.onWheelObservable.add((pi) => {\r\n if (!this._pointerIsOver || this.isReadOnly) {\r\n return;\r\n }\r\n if (this._verticalBar.isVisible == true) {\r\n if (pi.y < 0 && this._verticalBar.value > 0) {\r\n this._verticalBar.value -= this._wheelPrecision;\r\n } else if (pi.y > 0 && this._verticalBar.value < this._verticalBar.maximum) {\r\n this._verticalBar.value += this._wheelPrecision;\r\n }\r\n }\r\n if (this._horizontalBar.isVisible == true) {\r\n if (pi.x < 0 && this._horizontalBar.value < this._horizontalBar.maximum) {\r\n this._horizontalBar.value += this._wheelPrecision;\r\n } else if (pi.x > 0 && this._horizontalBar.value > 0) {\r\n this._horizontalBar.value -= this._wheelPrecision;\r\n }\r\n }\r\n });\r\n }\r\n\r\n public _renderHighlightSpecific(context: ICanvasRenderingContext): void {\r\n if (!this.isHighlighted) {\r\n return;\r\n }\r\n\r\n super._renderHighlightSpecific(context);\r\n\r\n this._grid._renderHighlightSpecific(context);\r\n\r\n context.restore();\r\n }\r\n\r\n /** Releases associated resources */\r\n public dispose() {\r\n this.onWheelObservable.remove(this._onWheelObserver);\r\n this._onWheelObserver = null;\r\n super.dispose();\r\n }\r\n}\r\nRegisterClass(\"BABYLON.GUI.ScrollViewer\", ScrollViewer);\r\n"]}
|
@@ -69,6 +69,18 @@ export declare class Slider3D extends Control3D {
|
|
69
69
|
* Gets the slider backplate material used by this control
|
70
70
|
*/
|
71
71
|
get sliderBackplateMaterial(): MRDLBackplateMaterial;
|
72
|
+
/**
|
73
|
+
* Gets the slider bar mesh used by this control
|
74
|
+
*/
|
75
|
+
get sliderBar(): AbstractMesh;
|
76
|
+
/**
|
77
|
+
* Gets the slider thumb mesh used by this control
|
78
|
+
*/
|
79
|
+
get sliderThumb(): AbstractMesh;
|
80
|
+
/**
|
81
|
+
* Gets the slider backplate mesh used by this control
|
82
|
+
*/
|
83
|
+
get sliderBackplate(): AbstractMesh;
|
72
84
|
/** Sets a boolean indicating if the control is visible */
|
73
85
|
set isVisible(value: boolean);
|
74
86
|
protected _createNode(scene: Scene): TransformNode;
|
package/3D/controls/slider3D.js
CHANGED
@@ -117,6 +117,24 @@ export class Slider3D extends Control3D {
|
|
117
117
|
get sliderBackplateMaterial() {
|
118
118
|
return this._sliderBackplateMaterial;
|
119
119
|
}
|
120
|
+
/**
|
121
|
+
* Gets the slider bar mesh used by this control
|
122
|
+
*/
|
123
|
+
get sliderBar() {
|
124
|
+
return this._sliderBar;
|
125
|
+
}
|
126
|
+
/**
|
127
|
+
* Gets the slider thumb mesh used by this control
|
128
|
+
*/
|
129
|
+
get sliderThumb() {
|
130
|
+
return this._sliderThumb;
|
131
|
+
}
|
132
|
+
/**
|
133
|
+
* Gets the slider backplate mesh used by this control
|
134
|
+
*/
|
135
|
+
get sliderBackplate() {
|
136
|
+
return this._sliderBackplate;
|
137
|
+
}
|
120
138
|
/** Sets a boolean indicating if the control is visible */
|
121
139
|
set isVisible(value) {
|
122
140
|
if (this._isVisible === value) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"slider3D.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/slider3D.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAClD,OAAO,EAAE,OAAO,EAAE,6CAA+B;AAGjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,sDAAwC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,gEAAkD;AAEhF,OAAO,EAAE,WAAW,EAAE,+CAAiC;AACvD,OAAO,EAAE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C,OAAO,GAAG,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAClF,CAAC;IAED;;OAEG;IACI,OAAO;QACV,KAAK,CAAC,OAAO,EAAE,CAAC;QAChB,IAAI,CAAC,UAAU,EAAE,OAAO,EAAE,CAAC;QAC3B,IAAI,CAAC,YAAY,EAAE,OAAO,EAAE,CAAC;QAC7B,IAAI,CAAC,kBAAkB,EAAE,OAAO,EAAE,CAAC;QACnC,IAAI,CAAC,oBAAoB,EAAE,OAAO,EAAE,CAAC;QACrC,IAAI,CAAC,gBAAgB,EAAE,OAAO,EAAE,CAAC;QACjC,IAAI,CAAC,wBAAwB,EAAE,OAAO,EAAE,CAAC;IAC7C,CAAC;;AAnRD;;GAEG;AACW,uBAAc,GAAW,2CAA2C,AAAtD,CAAuD;AAEnF;;GAEG;AACW,uBAAc,GAAW,2BAA2B,AAAtC,CAAuC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { Control3D } from \"./control3D\";\r\nimport { CreateBox } from \"core/Meshes/Builders/boxBuilder\";\r\nimport { PointerDragBehavior } from \"core/Behaviors/Meshes/pointerDragBehavior\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport { SceneLoader } from \"core/Loading/sceneLoader\";\r\nimport { MRDLSliderBarMaterial } from \"../materials/mrdl/mrdlSliderBarMaterial\";\r\nimport { MRDLSliderThumbMaterial } from \"../materials/mrdl/mrdlSliderThumbMaterial\";\r\nimport { MRDLBackplateMaterial } from \"../materials/mrdl/mrdlBackplateMaterial\";\r\n\r\nconst SLIDER_MIN: number = 0;\r\nconst SLIDER_MAX: number = 100;\r\nconst SLIDER_VAL: number = 50;\r\nconst SLIDER_STEP: number = 0;\r\nconst SLIDER_SCALING: number = 1.0;\r\nconst SLIDER_MARGIN: number = 0.2;\r\n\r\n/**\r\n * Class used to create a slider in 3D\r\n */\r\nexport class Slider3D extends Control3D {\r\n /**\r\n * Base Url for the models.\r\n */\r\n public static MODEL_BASE_URL: string = \"https://assets.babylonjs.com/meshes/MRTK/\";\r\n\r\n /**\r\n * File name for the 8x4 model.\r\n */\r\n public static MODEL_FILENAME: string = \"mrtk-fluent-backplate.glb\";\r\n\r\n private _sliderBackplate: AbstractMesh;\r\n private _sliderBackplateMaterial: MRDLBackplateMaterial;\r\n private _sliderBarMaterial: MRDLSliderBarMaterial;\r\n private _sliderThumbMaterial: MRDLSliderThumbMaterial;\r\n private _sliderThumb: AbstractMesh;\r\n private _sliderBar: AbstractMesh;\r\n private _sliderBackplateVisible: boolean;\r\n\r\n private _minimum: number;\r\n private _maximum: number;\r\n private _value: number;\r\n private _step: number;\r\n\r\n private _draggedPosition: number;\r\n\r\n /** Observable raised when the sldier value changes */\r\n public onValueChangedObservable = new Observable<number>();\r\n\r\n /**\r\n * Creates a new slider\r\n * @param name defines the control name\r\n * @param sliderBackplateVisible defines if the control has a backplate, default is false\r\n */\r\n constructor(name?: string, sliderBackplateVisible?: boolean) {\r\n super(name);\r\n this._sliderBackplateVisible = sliderBackplateVisible || false;\r\n\r\n this._minimum = SLIDER_MIN;\r\n this._maximum = SLIDER_MAX;\r\n this._step = SLIDER_STEP;\r\n this._value = SLIDER_VAL;\r\n }\r\n\r\n /**\r\n * Gets the mesh used to render this control\r\n */\r\n public get mesh(): Nullable<AbstractMesh> {\r\n if (this.node) {\r\n return this._sliderThumb;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /** Gets or sets minimum value */\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 = Math.max(value, SLIDER_MIN);\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 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 = Math.max(value, this._minimum);\r\n this._value = Math.max(Math.min(this._value, this._maximum), this._minimum);\r\n }\r\n\r\n /** Gets or sets step value */\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 = Math.max(Math.min(value, this._maximum - this._minimum), SLIDER_STEP);\r\n }\r\n\r\n /** Gets or sets current value */\r\n public get value(): number {\r\n return this._value;\r\n }\r\n\r\n public set value(value: number) {\r\n if (this._value === value) {\r\n return;\r\n }\r\n\r\n this._value = Math.max(Math.min(value, this._maximum), this._minimum);\r\n if (this._sliderThumb) {\r\n this._sliderThumb.position.x = this._convertToPosition(this.value);\r\n }\r\n this.onValueChangedObservable.notifyObservers(this._value);\r\n }\r\n\r\n protected get start(): number {\r\n if (!this.node) {\r\n return -SLIDER_SCALING / 2;\r\n }\r\n\r\n return this._sliderBar.position.x - this._sliderBar.scaling.x / 2;\r\n }\r\n\r\n protected get end(): number {\r\n if (!this.node) {\r\n return SLIDER_SCALING / 2;\r\n }\r\n\r\n return this._sliderBar.position.x + this._sliderBar.scaling.x / 2;\r\n }\r\n\r\n /**\r\n * Gets the slider bar material used by this control\r\n */\r\n public get sliderBarMaterial(): MRDLSliderBarMaterial {\r\n return this._sliderBarMaterial;\r\n }\r\n\r\n /**\r\n * Gets the slider thumb material used by this control\r\n */\r\n public get sliderThumbMaterial(): MRDLSliderThumbMaterial {\r\n return this._sliderThumbMaterial;\r\n }\r\n\r\n /**\r\n * Gets the slider backplate material used by this control\r\n */\r\n public get sliderBackplateMaterial(): MRDLBackplateMaterial {\r\n return this._sliderBackplateMaterial;\r\n }\r\n\r\n /** Sets a boolean indicating if the control is visible */\r\n public set isVisible(value: boolean) {\r\n if (this._isVisible === value) {\r\n return;\r\n }\r\n\r\n this._isVisible = value;\r\n\r\n this.node?.setEnabled(value);\r\n }\r\n\r\n // Mesh association\r\n protected _createNode(scene: Scene): TransformNode {\r\n const sliderBackplate = CreateBox(\r\n `${this.name}_sliderbackplate`,\r\n {\r\n width: 1.0,\r\n height: 1.0,\r\n depth: 1.0,\r\n },\r\n scene\r\n );\r\n sliderBackplate.isPickable = false;\r\n sliderBackplate.visibility = 0;\r\n sliderBackplate.scaling = new Vector3(1, 0.5, 0.8);\r\n\r\n SceneLoader.ImportMeshAsync(undefined, Slider3D.MODEL_BASE_URL, Slider3D.MODEL_FILENAME, scene).then((result) => {\r\n // make all meshes not pickable. Required meshes' pickable state will be set later.\r\n result.meshes.forEach((m) => {\r\n m.isPickable = false;\r\n });\r\n const sliderBackplateModel = result.meshes[1];\r\n const sliderBarModel = result.meshes[1].clone(`${this.name}_sliderbar`, sliderBackplate);\r\n const sliderThumbModel = result.meshes[1].clone(`${this.name}_sliderthumb`, sliderBackplate);\r\n sliderBackplateModel.visibility = 0;\r\n\r\n if (this._sliderBackplateVisible) {\r\n sliderBackplateModel.visibility = 1;\r\n sliderBackplateModel.name = `${this.name}_sliderbackplate`;\r\n sliderBackplateModel.scaling.x = 1;\r\n sliderBackplateModel.scaling.z = 0.2;\r\n sliderBackplateModel.parent = sliderBackplate;\r\n if (this._sliderBackplateMaterial) {\r\n sliderBackplateModel.material = this._sliderBackplateMaterial;\r\n }\r\n this._sliderBackplate = sliderBackplateModel;\r\n }\r\n\r\n if (sliderBarModel) {\r\n sliderBarModel.parent = sliderBackplate;\r\n sliderBarModel.position.z = -0.1;\r\n sliderBarModel.scaling = new Vector3(SLIDER_SCALING - SLIDER_MARGIN, 0.04, 0.3);\r\n if (this._sliderBarMaterial) {\r\n sliderBarModel.material = this._sliderBarMaterial;\r\n }\r\n this._sliderBar = sliderBarModel;\r\n }\r\n\r\n if (sliderThumbModel) {\r\n sliderThumbModel.parent = sliderBackplate;\r\n sliderThumbModel.isPickable = true;\r\n sliderThumbModel.position.z = -0.115;\r\n sliderThumbModel.scaling = new Vector3(0.025, 0.3, 0.6);\r\n sliderThumbModel.position.x = this._convertToPosition(this.value);\r\n sliderThumbModel.addBehavior(this._createBehavior());\r\n if (this._sliderThumbMaterial) {\r\n sliderThumbModel.material = this._sliderThumbMaterial;\r\n }\r\n this._sliderThumb = sliderThumbModel;\r\n }\r\n\r\n this._injectGUI3DReservedDataStore(sliderBackplate).control = this;\r\n sliderBackplate.getChildMeshes().forEach((mesh) => {\r\n this._injectGUI3DReservedDataStore(mesh).control = this;\r\n });\r\n });\r\n\r\n this._affectMaterial(sliderBackplate);\r\n return sliderBackplate;\r\n }\r\n\r\n protected _affectMaterial(mesh: AbstractMesh) {\r\n this._sliderBackplateMaterial = this._sliderBackplateMaterial ?? new MRDLBackplateMaterial(`${this.name}_sliderbackplate_material`, mesh.getScene());\r\n this._sliderBarMaterial = this._sliderBarMaterial ?? new MRDLSliderBarMaterial(`${this.name}_sliderbar_material`, mesh.getScene());\r\n this._sliderThumbMaterial = this._sliderThumbMaterial ?? new MRDLSliderThumbMaterial(`${this.name}_sliderthumb_material`, mesh.getScene());\r\n }\r\n\r\n private _createBehavior(): PointerDragBehavior {\r\n const pointerDragBehavior = new PointerDragBehavior({ dragAxis: Vector3.Right() });\r\n pointerDragBehavior.moveAttached = false;\r\n\r\n pointerDragBehavior.onDragStartObservable.add(() => {\r\n this._draggedPosition = this._sliderThumb.position.x;\r\n });\r\n\r\n pointerDragBehavior.onDragObservable.add((event) => {\r\n this._draggedPosition += event.dragDistance / this.scaling.x;\r\n this.value = this._convertToValue(this._draggedPosition);\r\n });\r\n\r\n return pointerDragBehavior;\r\n }\r\n\r\n private _convertToPosition(value: number): number {\r\n const position = ((value - this.minimum) / (this.maximum - this.minimum)) * (this.end - this.start) + this.start;\r\n return Math.min(Math.max(position, this.start), this.end);\r\n }\r\n\r\n private _convertToValue(position: number): number {\r\n let value = ((position - this.start) / (this.end - this.start)) * (this.maximum - this.minimum);\r\n value = this.step ? Math.round(value / this.step) * this.step : value;\r\n\r\n return Math.max(Math.min(this.minimum + value, this._maximum), this._minimum);\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public dispose() {\r\n super.dispose();\r\n this._sliderBar?.dispose();\r\n this._sliderThumb?.dispose();\r\n this._sliderBarMaterial?.dispose();\r\n this._sliderThumbMaterial?.dispose();\r\n this._sliderBackplate?.dispose();\r\n this._sliderBackplateMaterial?.dispose();\r\n }\r\n}\r\n"]}
|
1
|
+
{"version":3,"file":"slider3D.js","sourceRoot":"","sources":["../../../../../dev/gui/src/3D/controls/slider3D.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,2CAA6B;AAClD,OAAO,EAAE,OAAO,EAAE,6CAA+B;AAGjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,sDAAwC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,gEAAkD;AAEhF,OAAO,EAAE,WAAW,EAAE,+CAAiC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yCAAyC,CAAC;AAEhF,MAAM,UAAU,GAAW,CAAC,CAAC;AAC7B,MAAM,UAAU,GAAW,GAAG,CAAC;AAC/B,MAAM,UAAU,GAAW,EAAE,CAAC;AAC9B,MAAM,WAAW,GAAW,CAAC,CAAC;AAC9B,MAAM,cAAc,GAAW,GAAG,CAAC;AACnC,MAAM,aAAa,GAAW,GAAG,CAAC;AAElC;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,SAAS;IA6BnC;;;;OAIG;IACH,YAAY,IAAa,EAAE,sBAAgC;QACvD,KAAK,CAAC,IAAI,CAAC,CAAC;QAThB,sDAAsD;QAC/C,6BAAwB,GAAG,IAAI,UA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QACnC,IAAI,CAAC,oBAAoB,EAAE,OAAO,EAAE,CAAC;QACrC,IAAI,CAAC,gBAAgB,EAAE,OAAO,EAAE,CAAC;QACjC,IAAI,CAAC,wBAAwB,EAAE,OAAO,EAAE,CAAC;IAC7C,CAAC;;AAxSD;;GAEG;AACW,uBAAc,GAAW,2CAA2C,AAAtD,CAAuD;AAEnF;;GAEG;AACW,uBAAc,GAAW,2BAA2B,AAAtC,CAAuC","sourcesContent":["/* eslint-disable @typescript-eslint/naming-convention */\r\nimport type { Nullable } from \"core/types\";\r\nimport { Observable } from \"core/Misc/observable\";\r\nimport { Vector3 } from \"core/Maths/math.vector\";\r\nimport type { TransformNode } from \"core/Meshes/transformNode\";\r\nimport type { Scene } from \"core/scene\";\r\nimport { Control3D } from \"./control3D\";\r\nimport { CreateBox } from \"core/Meshes/Builders/boxBuilder\";\r\nimport { PointerDragBehavior } from \"core/Behaviors/Meshes/pointerDragBehavior\";\r\nimport type { AbstractMesh } from \"core/Meshes/abstractMesh\";\r\nimport { SceneLoader } from \"core/Loading/sceneLoader\";\r\nimport { MRDLSliderBarMaterial } from \"../materials/mrdl/mrdlSliderBarMaterial\";\r\nimport { MRDLSliderThumbMaterial } from \"../materials/mrdl/mrdlSliderThumbMaterial\";\r\nimport { MRDLBackplateMaterial } from \"../materials/mrdl/mrdlBackplateMaterial\";\r\n\r\nconst SLIDER_MIN: number = 0;\r\nconst SLIDER_MAX: number = 100;\r\nconst SLIDER_VAL: number = 50;\r\nconst SLIDER_STEP: number = 0;\r\nconst SLIDER_SCALING: number = 1.0;\r\nconst SLIDER_MARGIN: number = 0.2;\r\n\r\n/**\r\n * Class used to create a slider in 3D\r\n */\r\nexport class Slider3D extends Control3D {\r\n /**\r\n * Base Url for the models.\r\n */\r\n public static MODEL_BASE_URL: string = \"https://assets.babylonjs.com/meshes/MRTK/\";\r\n\r\n /**\r\n * File name for the 8x4 model.\r\n */\r\n public static MODEL_FILENAME: string = \"mrtk-fluent-backplate.glb\";\r\n\r\n private _sliderBackplate: AbstractMesh;\r\n private _sliderBackplateMaterial: MRDLBackplateMaterial;\r\n private _sliderBarMaterial: MRDLSliderBarMaterial;\r\n private _sliderThumbMaterial: MRDLSliderThumbMaterial;\r\n private _sliderThumb: AbstractMesh;\r\n private _sliderBar: AbstractMesh;\r\n private _sliderBackplateVisible: boolean;\r\n\r\n private _minimum: number;\r\n private _maximum: number;\r\n private _value: number;\r\n private _step: number;\r\n\r\n private _draggedPosition: number;\r\n\r\n /** Observable raised when the sldier value changes */\r\n public onValueChangedObservable = new Observable<number>();\r\n\r\n /**\r\n * Creates a new slider\r\n * @param name defines the control name\r\n * @param sliderBackplateVisible defines if the control has a backplate, default is false\r\n */\r\n constructor(name?: string, sliderBackplateVisible?: boolean) {\r\n super(name);\r\n this._sliderBackplateVisible = sliderBackplateVisible || false;\r\n\r\n this._minimum = SLIDER_MIN;\r\n this._maximum = SLIDER_MAX;\r\n this._step = SLIDER_STEP;\r\n this._value = SLIDER_VAL;\r\n }\r\n\r\n /**\r\n * Gets the mesh used to render this control\r\n */\r\n public get mesh(): Nullable<AbstractMesh> {\r\n if (this.node) {\r\n return this._sliderThumb;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /** Gets or sets minimum value */\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 = Math.max(value, SLIDER_MIN);\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 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 = Math.max(value, this._minimum);\r\n this._value = Math.max(Math.min(this._value, this._maximum), this._minimum);\r\n }\r\n\r\n /** Gets or sets step value */\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 = Math.max(Math.min(value, this._maximum - this._minimum), SLIDER_STEP);\r\n }\r\n\r\n /** Gets or sets current value */\r\n public get value(): number {\r\n return this._value;\r\n }\r\n\r\n public set value(value: number) {\r\n if (this._value === value) {\r\n return;\r\n }\r\n\r\n this._value = Math.max(Math.min(value, this._maximum), this._minimum);\r\n if (this._sliderThumb) {\r\n this._sliderThumb.position.x = this._convertToPosition(this.value);\r\n }\r\n this.onValueChangedObservable.notifyObservers(this._value);\r\n }\r\n\r\n protected get start(): number {\r\n if (!this.node) {\r\n return -SLIDER_SCALING / 2;\r\n }\r\n\r\n return this._sliderBar.position.x - this._sliderBar.scaling.x / 2;\r\n }\r\n\r\n protected get end(): number {\r\n if (!this.node) {\r\n return SLIDER_SCALING / 2;\r\n }\r\n\r\n return this._sliderBar.position.x + this._sliderBar.scaling.x / 2;\r\n }\r\n\r\n /**\r\n * Gets the slider bar material used by this control\r\n */\r\n public get sliderBarMaterial(): MRDLSliderBarMaterial {\r\n return this._sliderBarMaterial;\r\n }\r\n\r\n /**\r\n * Gets the slider thumb material used by this control\r\n */\r\n public get sliderThumbMaterial(): MRDLSliderThumbMaterial {\r\n return this._sliderThumbMaterial;\r\n }\r\n\r\n /**\r\n * Gets the slider backplate material used by this control\r\n */\r\n public get sliderBackplateMaterial(): MRDLBackplateMaterial {\r\n return this._sliderBackplateMaterial;\r\n }\r\n\r\n /**\r\n * Gets the slider bar mesh used by this control\r\n */\r\n public get sliderBar(): AbstractMesh {\r\n return this._sliderBar;\r\n }\r\n\r\n /**\r\n * Gets the slider thumb mesh used by this control\r\n */\r\n public get sliderThumb(): AbstractMesh {\r\n return this._sliderThumb;\r\n }\r\n\r\n /**\r\n * Gets the slider backplate mesh used by this control\r\n */\r\n public get sliderBackplate(): AbstractMesh {\r\n return this._sliderBackplate;\r\n }\r\n\r\n /** Sets a boolean indicating if the control is visible */\r\n public set isVisible(value: boolean) {\r\n if (this._isVisible === value) {\r\n return;\r\n }\r\n\r\n this._isVisible = value;\r\n\r\n this.node?.setEnabled(value);\r\n }\r\n\r\n // Mesh association\r\n protected _createNode(scene: Scene): TransformNode {\r\n const sliderBackplate = CreateBox(\r\n `${this.name}_sliderbackplate`,\r\n {\r\n width: 1.0,\r\n height: 1.0,\r\n depth: 1.0,\r\n },\r\n scene\r\n );\r\n sliderBackplate.isPickable = false;\r\n sliderBackplate.visibility = 0;\r\n sliderBackplate.scaling = new Vector3(1, 0.5, 0.8);\r\n\r\n SceneLoader.ImportMeshAsync(undefined, Slider3D.MODEL_BASE_URL, Slider3D.MODEL_FILENAME, scene).then((result) => {\r\n // make all meshes not pickable. Required meshes' pickable state will be set later.\r\n result.meshes.forEach((m) => {\r\n m.isPickable = false;\r\n });\r\n const sliderBackplateModel = result.meshes[1];\r\n const sliderBarModel = result.meshes[1].clone(`${this.name}_sliderbar`, sliderBackplate);\r\n const sliderThumbModel = result.meshes[1].clone(`${this.name}_sliderthumb`, sliderBackplate);\r\n sliderBackplateModel.visibility = 0;\r\n\r\n if (this._sliderBackplateVisible) {\r\n sliderBackplateModel.visibility = 1;\r\n sliderBackplateModel.name = `${this.name}_sliderbackplate`;\r\n sliderBackplateModel.scaling.x = 1;\r\n sliderBackplateModel.scaling.z = 0.2;\r\n sliderBackplateModel.parent = sliderBackplate;\r\n if (this._sliderBackplateMaterial) {\r\n sliderBackplateModel.material = this._sliderBackplateMaterial;\r\n }\r\n this._sliderBackplate = sliderBackplateModel;\r\n }\r\n\r\n if (sliderBarModel) {\r\n sliderBarModel.parent = sliderBackplate;\r\n sliderBarModel.position.z = -0.1;\r\n sliderBarModel.scaling = new Vector3(SLIDER_SCALING - SLIDER_MARGIN, 0.04, 0.3);\r\n if (this._sliderBarMaterial) {\r\n sliderBarModel.material = this._sliderBarMaterial;\r\n }\r\n this._sliderBar = sliderBarModel;\r\n }\r\n\r\n if (sliderThumbModel) {\r\n sliderThumbModel.parent = sliderBackplate;\r\n sliderThumbModel.isPickable = true;\r\n sliderThumbModel.position.z = -0.115;\r\n sliderThumbModel.scaling = new Vector3(0.025, 0.3, 0.6);\r\n sliderThumbModel.position.x = this._convertToPosition(this.value);\r\n sliderThumbModel.addBehavior(this._createBehavior());\r\n if (this._sliderThumbMaterial) {\r\n sliderThumbModel.material = this._sliderThumbMaterial;\r\n }\r\n this._sliderThumb = sliderThumbModel;\r\n }\r\n\r\n this._injectGUI3DReservedDataStore(sliderBackplate).control = this;\r\n sliderBackplate.getChildMeshes().forEach((mesh) => {\r\n this._injectGUI3DReservedDataStore(mesh).control = this;\r\n });\r\n });\r\n\r\n this._affectMaterial(sliderBackplate);\r\n return sliderBackplate;\r\n }\r\n\r\n protected _affectMaterial(mesh: AbstractMesh) {\r\n this._sliderBackplateMaterial = this._sliderBackplateMaterial ?? new MRDLBackplateMaterial(`${this.name}_sliderbackplate_material`, mesh.getScene());\r\n this._sliderBarMaterial = this._sliderBarMaterial ?? new MRDLSliderBarMaterial(`${this.name}_sliderbar_material`, mesh.getScene());\r\n this._sliderThumbMaterial = this._sliderThumbMaterial ?? new MRDLSliderThumbMaterial(`${this.name}_sliderthumb_material`, mesh.getScene());\r\n }\r\n\r\n private _createBehavior(): PointerDragBehavior {\r\n const pointerDragBehavior = new PointerDragBehavior({ dragAxis: Vector3.Right() });\r\n pointerDragBehavior.moveAttached = false;\r\n\r\n pointerDragBehavior.onDragStartObservable.add(() => {\r\n this._draggedPosition = this._sliderThumb.position.x;\r\n });\r\n\r\n pointerDragBehavior.onDragObservable.add((event) => {\r\n this._draggedPosition += event.dragDistance / this.scaling.x;\r\n this.value = this._convertToValue(this._draggedPosition);\r\n });\r\n\r\n return pointerDragBehavior;\r\n }\r\n\r\n private _convertToPosition(value: number): number {\r\n const position = ((value - this.minimum) / (this.maximum - this.minimum)) * (this.end - this.start) + this.start;\r\n return Math.min(Math.max(position, this.start), this.end);\r\n }\r\n\r\n private _convertToValue(position: number): number {\r\n let value = ((position - this.start) / (this.end - this.start)) * (this.maximum - this.minimum);\r\n value = this.step ? Math.round(value / this.step) * this.step : value;\r\n\r\n return Math.max(Math.min(this.minimum + value, this._maximum), this._minimum);\r\n }\r\n\r\n /**\r\n * Releases all associated resources\r\n */\r\n public dispose() {\r\n super.dispose();\r\n this._sliderBar?.dispose();\r\n this._sliderThumb?.dispose();\r\n this._sliderBarMaterial?.dispose();\r\n this._sliderThumbMaterial?.dispose();\r\n this._sliderBackplate?.dispose();\r\n this._sliderBackplateMaterial?.dispose();\r\n }\r\n}\r\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@babylonjs/gui",
|
3
|
-
"version": "7.
|
3
|
+
"version": "7.2.0",
|
4
4
|
"main": "index.js",
|
5
5
|
"module": "index.js",
|
6
6
|
"types": "index.d.ts",
|
@@ -18,7 +18,7 @@
|
|
18
18
|
"postcompile": "build-tools -c add-js-to-es6"
|
19
19
|
},
|
20
20
|
"devDependencies": {
|
21
|
-
"@babylonjs/core": "^7.
|
21
|
+
"@babylonjs/core": "^7.2.0",
|
22
22
|
"@dev/build-tools": "^1.0.0",
|
23
23
|
"@lts/gui": "1.0.0"
|
24
24
|
},
|