@babylonjs/gui 5.21.0 → 5.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/2D/adtInstrumentation.js +70 -90
- package/2D/adtInstrumentation.js.map +1 -1
- package/2D/advancedDynamicTexture.d.ts +12 -0
- package/2D/advancedDynamicTexture.js +569 -622
- package/2D/advancedDynamicTexture.js.map +1 -1
- package/2D/controls/button.js +76 -90
- package/2D/controls/button.js.map +1 -1
- package/2D/controls/checkbox.js +86 -106
- package/2D/controls/checkbox.js.map +1 -1
- package/2D/controls/colorpicker.js +395 -415
- package/2D/controls/colorpicker.js.map +1 -1
- package/2D/controls/container.js +187 -230
- package/2D/controls/container.js.map +1 -1
- package/2D/controls/control.js +1067 -1353
- package/2D/controls/control.js.map +1 -1
- package/2D/controls/displayGrid.js +152 -196
- package/2D/controls/displayGrid.js.map +1 -1
- package/2D/controls/ellipse.js +32 -40
- package/2D/controls/ellipse.js.map +1 -1
- package/2D/controls/focusableButton.js +30 -35
- package/2D/controls/focusableButton.js.map +1 -1
- package/2D/controls/grid.js +172 -212
- package/2D/controls/grid.js.map +1 -1
- package/2D/controls/image.js +489 -592
- package/2D/controls/image.js.map +1 -1
- package/2D/controls/inputPassword.js +9 -16
- package/2D/controls/inputPassword.js.map +1 -1
- package/2D/controls/inputText.js +380 -467
- package/2D/controls/inputText.js.map +1 -1
- package/2D/controls/inputTextArea.js +234 -273
- package/2D/controls/inputTextArea.js.map +1 -1
- package/2D/controls/line.js +147 -198
- package/2D/controls/line.js.map +1 -1
- package/2D/controls/multiLine.js +87 -113
- package/2D/controls/multiLine.js.map +1 -1
- package/2D/controls/radioButton.js +106 -127
- package/2D/controls/radioButton.js.map +1 -1
- package/2D/controls/rectangle.js +60 -72
- package/2D/controls/rectangle.js.map +1 -1
- package/2D/controls/scrollViewers/scrollViewer.js +439 -543
- package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
- package/2D/controls/scrollViewers/scrollViewerWindow.js +99 -118
- package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -1
- package/2D/controls/selector.js +241 -329
- package/2D/controls/selector.js.map +1 -1
- package/2D/controls/sliders/baseSlider.js +182 -230
- package/2D/controls/sliders/baseSlider.js.map +1 -1
- package/2D/controls/sliders/imageBasedSlider.js +86 -109
- package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
- package/2D/controls/sliders/imageScrollBar.js +148 -178
- package/2D/controls/sliders/imageScrollBar.js.map +1 -1
- package/2D/controls/sliders/scrollBar.js +64 -80
- package/2D/controls/sliders/scrollBar.js.map +1 -1
- package/2D/controls/sliders/slider.js +91 -115
- package/2D/controls/sliders/slider.js.map +1 -1
- package/2D/controls/stackPanel.js +114 -135
- package/2D/controls/stackPanel.js.map +1 -1
- package/2D/controls/statics.js +5 -5
- package/2D/controls/statics.js.map +1 -1
- package/2D/controls/textBlock.js +322 -384
- package/2D/controls/textBlock.js.map +1 -1
- package/2D/controls/textWrapper.js +27 -41
- package/2D/controls/textWrapper.js.map +1 -1
- package/2D/controls/toggleButton.js +105 -121
- package/2D/controls/toggleButton.js.map +1 -1
- package/2D/controls/virtualKeyboard.js +101 -123
- package/2D/controls/virtualKeyboard.js.map +1 -1
- package/2D/math2D.js +62 -70
- package/2D/math2D.js.map +1 -1
- package/2D/measure.js +30 -32
- package/2D/measure.js.map +1 -1
- package/2D/multiLinePoint.js +71 -89
- package/2D/multiLinePoint.js.map +1 -1
- package/2D/style.js +55 -73
- package/2D/style.js.map +1 -1
- package/2D/valueAndUnit.js +71 -104
- package/2D/valueAndUnit.js.map +1 -1
- package/2D/xmlLoader.js +70 -84
- package/2D/xmlLoader.js.map +1 -1
- package/3D/behaviors/defaultBehavior.js +40 -59
- package/3D/behaviors/defaultBehavior.js.map +1 -1
- package/3D/controls/abstractButton3D.js +8 -12
- package/3D/controls/abstractButton3D.js.map +1 -1
- package/3D/controls/button3D.js +30 -35
- package/3D/controls/button3D.js.map +1 -1
- package/3D/controls/container3D.js +57 -71
- package/3D/controls/container3D.js.map +1 -1
- package/3D/controls/contentDisplay3D.js +47 -60
- package/3D/controls/contentDisplay3D.js.map +1 -1
- package/3D/controls/control3D.js +123 -158
- package/3D/controls/control3D.js.map +1 -1
- package/3D/controls/cylinderPanel.js +28 -38
- package/3D/controls/cylinderPanel.js.map +1 -1
- package/3D/controls/handMenu.js +20 -29
- package/3D/controls/handMenu.js.map +1 -1
- package/3D/controls/holographicBackplate.js +52 -72
- package/3D/controls/holographicBackplate.js.map +1 -1
- package/3D/controls/holographicButton.js +160 -200
- package/3D/controls/holographicButton.js.map +1 -1
- package/3D/controls/holographicSlate.js +176 -206
- package/3D/controls/holographicSlate.js.map +1 -1
- package/3D/controls/meshButton3D.js +24 -30
- package/3D/controls/meshButton3D.js.map +1 -1
- package/3D/controls/nearMenu.js +57 -71
- package/3D/controls/nearMenu.js.map +1 -1
- package/3D/controls/planePanel.js +6 -13
- package/3D/controls/planePanel.js.map +1 -1
- package/3D/controls/scatterPanel.js +43 -54
- package/3D/controls/scatterPanel.js.map +1 -1
- package/3D/controls/slider3D.js +168 -222
- package/3D/controls/slider3D.js.map +1 -1
- package/3D/controls/spherePanel.js +29 -39
- package/3D/controls/spherePanel.js.map +1 -1
- package/3D/controls/stackPanel3D.js +36 -49
- package/3D/controls/stackPanel3D.js.map +1 -1
- package/3D/controls/touchButton3D.js +126 -154
- package/3D/controls/touchButton3D.js.map +1 -1
- package/3D/controls/touchHolographicButton.js +223 -272
- package/3D/controls/touchHolographicButton.js.map +1 -1
- package/3D/controls/touchHolographicMenu.js +55 -66
- package/3D/controls/touchHolographicMenu.js.map +1 -1
- package/3D/controls/touchMeshButton3D.js +24 -30
- package/3D/controls/touchMeshButton3D.js.map +1 -1
- package/3D/controls/volumeBasedPanel.js +85 -107
- package/3D/controls/volumeBasedPanel.js.map +1 -1
- package/3D/gizmos/gizmoHandle.js +68 -103
- package/3D/gizmos/gizmoHandle.js.map +1 -1
- package/3D/gizmos/slateGizmo.js +165 -182
- package/3D/gizmos/slateGizmo.js.map +1 -1
- package/3D/gui3DManager.js +76 -101
- package/3D/gui3DManager.js.map +1 -1
- package/3D/materials/fluent/fluentMaterial.js +110 -119
- package/3D/materials/fluent/fluentMaterial.js.map +1 -1
- package/3D/materials/fluent/shaders/fluent.fragment.js +20 -3
- package/3D/materials/fluent/shaders/fluent.fragment.js.map +1 -1
- package/3D/materials/fluent/shaders/fluent.vertex.js +11 -3
- package/3D/materials/fluent/shaders/fluent.vertex.js.map +1 -1
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +168 -177
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js +9 -3
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js.map +1 -1
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js +15 -3
- package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js.map +1 -1
- package/3D/materials/fluentButton/fluentButtonMaterial.js +205 -213
- package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
- package/3D/materials/fluentButton/shaders/fluentButton.fragment.js +6 -3
- package/3D/materials/fluentButton/shaders/fluentButton.fragment.js.map +1 -1
- package/3D/materials/fluentButton/shaders/fluentButton.vertex.js +6 -3
- package/3D/materials/fluentButton/shaders/fluentButton.vertex.js.map +1 -1
- package/3D/materials/handle/handleMaterial.js +56 -69
- package/3D/materials/handle/handleMaterial.js.map +1 -1
- package/3D/materials/handle/shaders/handle.fragment.js +3 -3
- package/3D/materials/handle/shaders/handle.fragment.js.map +1 -1
- package/3D/materials/handle/shaders/handle.vertex.js +3 -3
- package/3D/materials/handle/shaders/handle.vertex.js.map +1 -1
- package/3D/materials/mrdl/mrdlBackplateMaterial.js +158 -166
- package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js +322 -330
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +322 -330
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js +9 -3
- package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js +6 -3
- package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js +24 -3
- package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js +12 -3
- package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js +24 -3
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js.map +1 -1
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js +12 -3
- package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js.map +1 -1
- package/3D/vector3WithInfo.js +6 -12
- package/3D/vector3WithInfo.js.map +1 -1
- package/legacy/legacy.js +1 -1
- package/legacy/legacy.js.map +1 -1
- package/package.json +3 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __decorate
|
|
1
|
+
import { __decorate } from "@babylonjs/core/tslib.es6.js";
|
|
2
2
|
import { Rectangle } from "../rectangle.js";
|
|
3
3
|
import { Grid } from "../grid.js";
|
|
4
4
|
import { Control } from "../control.js";
|
|
@@ -10,165 +10,138 @@ import { serialize } from "@babylonjs/core/Misc/decorators.js";
|
|
|
10
10
|
/**
|
|
11
11
|
* Class used to hold a viewer window and sliders in a grid
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
|
-
__extends(ScrollViewer, _super);
|
|
13
|
+
export class ScrollViewer extends Rectangle {
|
|
15
14
|
/**
|
|
16
15
|
* Creates a new ScrollViewer
|
|
17
16
|
* @param name of ScrollViewer
|
|
18
17
|
* @param isImageBased
|
|
19
18
|
*/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
19
|
+
constructor(name, isImageBased) {
|
|
20
|
+
super(name);
|
|
21
|
+
this._barSize = 20;
|
|
22
|
+
this._pointerIsOver = false;
|
|
23
|
+
this._wheelPrecision = 0.05;
|
|
24
|
+
this._thumbLength = 0.5;
|
|
25
|
+
this._thumbHeight = 1;
|
|
26
|
+
this._barImageHeight = 1;
|
|
27
|
+
this._horizontalBarImageHeight = 1;
|
|
28
|
+
this._verticalBarImageHeight = 1;
|
|
29
|
+
this._oldWindowContentsWidth = 0;
|
|
30
|
+
this._oldWindowContentsHeight = 0;
|
|
31
|
+
this._forceHorizontalBar = false;
|
|
32
|
+
this._forceVerticalBar = false;
|
|
33
|
+
this._useImageBar = isImageBased ? isImageBased : false;
|
|
34
|
+
this.onDirtyObservable.add(() => {
|
|
35
|
+
this._horizontalBarSpace.color = this.color;
|
|
36
|
+
this._verticalBarSpace.color = this.color;
|
|
37
|
+
this._dragSpace.color = this.color;
|
|
39
38
|
});
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
this.onPointerEnterObservable.add(() => {
|
|
40
|
+
this._pointerIsOver = true;
|
|
42
41
|
});
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
this.onPointerOutObservable.add(() => {
|
|
43
|
+
this._pointerIsOver = false;
|
|
45
44
|
});
|
|
46
|
-
|
|
47
|
-
if (
|
|
48
|
-
|
|
49
|
-
|
|
45
|
+
this._grid = new Grid();
|
|
46
|
+
if (this._useImageBar) {
|
|
47
|
+
this._horizontalBar = new ImageScrollBar();
|
|
48
|
+
this._verticalBar = new ImageScrollBar();
|
|
50
49
|
}
|
|
51
50
|
else {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
51
|
+
this._horizontalBar = new ScrollBar();
|
|
52
|
+
this._verticalBar = new ScrollBar();
|
|
53
|
+
}
|
|
54
|
+
this._window = new _ScrollViewerWindow("scrollViewer_window");
|
|
55
|
+
this._window.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
|
|
56
|
+
this._window.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
|
|
57
|
+
this._grid.addColumnDefinition(1);
|
|
58
|
+
this._grid.addColumnDefinition(0, true);
|
|
59
|
+
this._grid.addRowDefinition(1);
|
|
60
|
+
this._grid.addRowDefinition(0, true);
|
|
61
|
+
super.addControl(this._grid);
|
|
62
|
+
this._grid.addControl(this._window, 0, 0);
|
|
63
|
+
this._verticalBarSpace = new Rectangle();
|
|
64
|
+
this._verticalBarSpace.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
|
|
65
|
+
this._verticalBarSpace.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
|
|
66
|
+
this._verticalBarSpace.thickness = 1;
|
|
67
|
+
this._grid.addControl(this._verticalBarSpace, 0, 1);
|
|
68
|
+
this._addBar(this._verticalBar, this._verticalBarSpace, true, Math.PI);
|
|
69
|
+
this._horizontalBarSpace = new Rectangle();
|
|
70
|
+
this._horizontalBarSpace.horizontalAlignment = Control.HORIZONTAL_ALIGNMENT_LEFT;
|
|
71
|
+
this._horizontalBarSpace.verticalAlignment = Control.VERTICAL_ALIGNMENT_TOP;
|
|
72
|
+
this._horizontalBarSpace.thickness = 1;
|
|
73
|
+
this._grid.addControl(this._horizontalBarSpace, 1, 0);
|
|
74
|
+
this._addBar(this._horizontalBar, this._horizontalBarSpace, false, 0);
|
|
75
|
+
this._dragSpace = new Rectangle();
|
|
76
|
+
this._dragSpace.thickness = 1;
|
|
77
|
+
this._grid.addControl(this._dragSpace, 1, 1);
|
|
79
78
|
// Colors
|
|
80
|
-
if (!
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Gets the vertical scrollbar
|
|
99
|
-
*/
|
|
100
|
-
get: function () {
|
|
101
|
-
return this._verticalBar;
|
|
102
|
-
},
|
|
103
|
-
enumerable: false,
|
|
104
|
-
configurable: true
|
|
105
|
-
});
|
|
79
|
+
if (!this._useImageBar) {
|
|
80
|
+
this.barColor = "grey";
|
|
81
|
+
this.barBackground = "transparent";
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Gets the horizontal scrollbar
|
|
86
|
+
*/
|
|
87
|
+
get horizontalBar() {
|
|
88
|
+
return this._horizontalBar;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Gets the vertical scrollbar
|
|
92
|
+
*/
|
|
93
|
+
get verticalBar() {
|
|
94
|
+
return this._verticalBar;
|
|
95
|
+
}
|
|
106
96
|
/**
|
|
107
97
|
* Adds a new control to the current container
|
|
108
98
|
* @param control defines the control to add
|
|
109
99
|
* @returns the current container
|
|
110
100
|
*/
|
|
111
|
-
|
|
101
|
+
addControl(control) {
|
|
112
102
|
if (!control) {
|
|
113
103
|
return this;
|
|
114
104
|
}
|
|
115
105
|
this._window.addControl(control);
|
|
116
106
|
return this;
|
|
117
|
-
}
|
|
107
|
+
}
|
|
118
108
|
/**
|
|
119
109
|
* Removes a control from the current container
|
|
120
110
|
* @param control defines the control to remove
|
|
121
111
|
* @returns the current container
|
|
122
112
|
*/
|
|
123
|
-
|
|
113
|
+
removeControl(control) {
|
|
124
114
|
this._window.removeControl(control);
|
|
125
115
|
return this;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
configurable: true
|
|
134
|
-
});
|
|
135
|
-
ScrollViewer.prototype._flagDescendantsAsMatrixDirty = function () {
|
|
136
|
-
for (var _i = 0, _a = this._children; _i < _a.length; _i++) {
|
|
137
|
-
var child = _a[_i];
|
|
116
|
+
}
|
|
117
|
+
/** Gets the list of children */
|
|
118
|
+
get children() {
|
|
119
|
+
return this._window.children;
|
|
120
|
+
}
|
|
121
|
+
_flagDescendantsAsMatrixDirty() {
|
|
122
|
+
for (const child of this._children) {
|
|
138
123
|
child._markMatrixAsDirty();
|
|
139
124
|
}
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
},
|
|
161
|
-
enumerable: false,
|
|
162
|
-
configurable: true
|
|
163
|
-
});
|
|
164
|
-
Object.defineProperty(ScrollViewer.prototype, "bucketHeight", {
|
|
165
|
-
/** Gets the bucket height */
|
|
166
|
-
get: function () {
|
|
167
|
-
return this._window.bucketHeight;
|
|
168
|
-
},
|
|
169
|
-
enumerable: false,
|
|
170
|
-
configurable: true
|
|
171
|
-
});
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Freezes or unfreezes the controls in the window.
|
|
128
|
+
* When controls are frozen, the scroll viewer can render a lot more quickly but updates to positions/sizes of controls
|
|
129
|
+
* are not taken into account. If you want to change positions/sizes, unfreeze, perform the changes then freeze again
|
|
130
|
+
*/
|
|
131
|
+
get freezeControls() {
|
|
132
|
+
return this._window.freezeControls;
|
|
133
|
+
}
|
|
134
|
+
set freezeControls(value) {
|
|
135
|
+
this._window.freezeControls = value;
|
|
136
|
+
}
|
|
137
|
+
/** Gets the bucket width */
|
|
138
|
+
get bucketWidth() {
|
|
139
|
+
return this._window.bucketWidth;
|
|
140
|
+
}
|
|
141
|
+
/** Gets the bucket height */
|
|
142
|
+
get bucketHeight() {
|
|
143
|
+
return this._window.bucketHeight;
|
|
144
|
+
}
|
|
172
145
|
/**
|
|
173
146
|
* Sets the bucket sizes.
|
|
174
147
|
* When freezeControls is true, setting a non-zero bucket size will improve performances by updating only
|
|
@@ -180,383 +153,310 @@ var ScrollViewer = /** @class */ (function (_super) {
|
|
|
180
153
|
* @param width width of the bucket
|
|
181
154
|
* @param height height of the bucket
|
|
182
155
|
*/
|
|
183
|
-
|
|
156
|
+
setBucketSizes(width, height) {
|
|
184
157
|
this._window.setBucketSizes(width, height);
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
set: function (value) {
|
|
209
|
-
this._grid.setColumnDefinition(1, value ? this._barSize : 0, true);
|
|
210
|
-
this._verticalBar.isVisible = value;
|
|
211
|
-
this._forceVerticalBar = value;
|
|
212
|
-
},
|
|
213
|
-
enumerable: false,
|
|
214
|
-
configurable: true
|
|
215
|
-
});
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Forces the horizontal scroll bar to be displayed
|
|
161
|
+
*/
|
|
162
|
+
get forceHorizontalBar() {
|
|
163
|
+
return this._forceHorizontalBar;
|
|
164
|
+
}
|
|
165
|
+
set forceHorizontalBar(value) {
|
|
166
|
+
this._grid.setRowDefinition(1, value ? this._barSize : 0, true);
|
|
167
|
+
this._horizontalBar.isVisible = value;
|
|
168
|
+
this._forceHorizontalBar = value;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Forces the vertical scroll bar to be displayed
|
|
172
|
+
*/
|
|
173
|
+
get forceVerticalBar() {
|
|
174
|
+
return this._forceVerticalBar;
|
|
175
|
+
}
|
|
176
|
+
set forceVerticalBar(value) {
|
|
177
|
+
this._grid.setColumnDefinition(1, value ? this._barSize : 0, true);
|
|
178
|
+
this._verticalBar.isVisible = value;
|
|
179
|
+
this._forceVerticalBar = value;
|
|
180
|
+
}
|
|
216
181
|
/** Reset the scroll viewer window to initial size */
|
|
217
|
-
|
|
182
|
+
resetWindow() {
|
|
218
183
|
this._window.width = "100%";
|
|
219
184
|
this._window.height = "100%";
|
|
220
|
-
}
|
|
221
|
-
|
|
185
|
+
}
|
|
186
|
+
_getTypeName() {
|
|
222
187
|
return "ScrollViewer";
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
|
|
188
|
+
}
|
|
189
|
+
_buildClientSizes() {
|
|
190
|
+
const ratio = this.host.idealRatio;
|
|
226
191
|
this._window.parentClientWidth = this._currentMeasure.width - (this._verticalBar.isVisible || this.forceVerticalBar ? this._barSize * ratio : 0) - 2 * this.thickness;
|
|
227
192
|
this._window.parentClientHeight = this._currentMeasure.height - (this._horizontalBar.isVisible || this.forceHorizontalBar ? this._barSize * ratio : 0) - 2 * this.thickness;
|
|
228
193
|
this._clientWidth = this._window.parentClientWidth;
|
|
229
194
|
this._clientHeight = this._window.parentClientHeight;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
|
|
195
|
+
}
|
|
196
|
+
_additionalProcessing(parentMeasure, context) {
|
|
197
|
+
super._additionalProcessing(parentMeasure, context);
|
|
233
198
|
this._buildClientSizes();
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
|
|
199
|
+
}
|
|
200
|
+
_postMeasure() {
|
|
201
|
+
super._postMeasure();
|
|
237
202
|
this._updateScroller();
|
|
238
203
|
this._setWindowPosition(false);
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
}
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
Object.defineProperty(ScrollViewer.prototype, "barBackground", {
|
|
487
|
-
/** Gets or sets the bar background */
|
|
488
|
-
get: function () {
|
|
489
|
-
return this._barBackground;
|
|
490
|
-
},
|
|
491
|
-
set: function (color) {
|
|
492
|
-
if (this._barBackground === color) {
|
|
493
|
-
return;
|
|
494
|
-
}
|
|
495
|
-
this._barBackground = color;
|
|
496
|
-
var hb = this._horizontalBar;
|
|
497
|
-
var vb = this._verticalBar;
|
|
498
|
-
hb.background = color;
|
|
499
|
-
vb.background = color;
|
|
500
|
-
this._dragSpace.background = color;
|
|
501
|
-
},
|
|
502
|
-
enumerable: false,
|
|
503
|
-
configurable: true
|
|
504
|
-
});
|
|
505
|
-
Object.defineProperty(ScrollViewer.prototype, "barImage", {
|
|
506
|
-
/** Gets or sets the bar background image */
|
|
507
|
-
get: function () {
|
|
508
|
-
return this._barBackgroundImage;
|
|
509
|
-
},
|
|
510
|
-
set: function (value) {
|
|
511
|
-
this._barBackgroundImage = value;
|
|
512
|
-
var hb = this._horizontalBar;
|
|
513
|
-
var vb = this._verticalBar;
|
|
514
|
-
hb.backgroundImage = value;
|
|
515
|
-
vb.backgroundImage = value;
|
|
516
|
-
},
|
|
517
|
-
enumerable: false,
|
|
518
|
-
configurable: true
|
|
519
|
-
});
|
|
520
|
-
Object.defineProperty(ScrollViewer.prototype, "horizontalBarImage", {
|
|
521
|
-
/** Gets or sets the horizontal bar background image */
|
|
522
|
-
get: function () {
|
|
523
|
-
return this._horizontalBarBackgroundImage;
|
|
524
|
-
},
|
|
525
|
-
set: function (value) {
|
|
526
|
-
this._horizontalBarBackgroundImage = value;
|
|
527
|
-
var hb = this._horizontalBar;
|
|
528
|
-
hb.backgroundImage = value;
|
|
529
|
-
},
|
|
530
|
-
enumerable: false,
|
|
531
|
-
configurable: true
|
|
532
|
-
});
|
|
533
|
-
Object.defineProperty(ScrollViewer.prototype, "verticalBarImage", {
|
|
534
|
-
/** Gets or sets the vertical bar background image */
|
|
535
|
-
get: function () {
|
|
536
|
-
return this._verticalBarBackgroundImage;
|
|
537
|
-
},
|
|
538
|
-
set: function (value) {
|
|
539
|
-
this._verticalBarBackgroundImage = value;
|
|
540
|
-
var vb = this._verticalBar;
|
|
541
|
-
vb.backgroundImage = value;
|
|
542
|
-
},
|
|
543
|
-
enumerable: false,
|
|
544
|
-
configurable: true
|
|
545
|
-
});
|
|
546
|
-
ScrollViewer.prototype._setWindowPosition = function (force) {
|
|
547
|
-
if (force === void 0) { force = true; }
|
|
548
|
-
var ratio = this.host.idealRatio;
|
|
549
|
-
var windowContentsWidth = this._window._currentMeasure.width;
|
|
550
|
-
var windowContentsHeight = this._window._currentMeasure.height;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Gets or sets the mouse wheel precision
|
|
207
|
+
* from 0 to 1 with a default value of 0.05
|
|
208
|
+
* */
|
|
209
|
+
get wheelPrecision() {
|
|
210
|
+
return this._wheelPrecision;
|
|
211
|
+
}
|
|
212
|
+
set wheelPrecision(value) {
|
|
213
|
+
if (this._wheelPrecision === value) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
if (value < 0) {
|
|
217
|
+
value = 0;
|
|
218
|
+
}
|
|
219
|
+
if (value > 1) {
|
|
220
|
+
value = 1;
|
|
221
|
+
}
|
|
222
|
+
this._wheelPrecision = value;
|
|
223
|
+
}
|
|
224
|
+
/** Gets or sets the scroll bar container background color */
|
|
225
|
+
get scrollBackground() {
|
|
226
|
+
return this._horizontalBarSpace.background;
|
|
227
|
+
}
|
|
228
|
+
set scrollBackground(color) {
|
|
229
|
+
if (this._horizontalBarSpace.background === color) {
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
this._horizontalBarSpace.background = color;
|
|
233
|
+
this._verticalBarSpace.background = color;
|
|
234
|
+
}
|
|
235
|
+
/** Gets or sets the bar color */
|
|
236
|
+
get barColor() {
|
|
237
|
+
return this._barColor;
|
|
238
|
+
}
|
|
239
|
+
set barColor(color) {
|
|
240
|
+
if (this._barColor === color) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
this._barColor = color;
|
|
244
|
+
this._horizontalBar.color = color;
|
|
245
|
+
this._verticalBar.color = color;
|
|
246
|
+
}
|
|
247
|
+
/** Gets or sets the bar image */
|
|
248
|
+
get thumbImage() {
|
|
249
|
+
return this._barImage;
|
|
250
|
+
}
|
|
251
|
+
set thumbImage(value) {
|
|
252
|
+
if (this._barImage === value) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
this._barImage = value;
|
|
256
|
+
const hb = this._horizontalBar;
|
|
257
|
+
const vb = this._verticalBar;
|
|
258
|
+
hb.thumbImage = value;
|
|
259
|
+
vb.thumbImage = value;
|
|
260
|
+
}
|
|
261
|
+
/** Gets or sets the horizontal bar image */
|
|
262
|
+
get horizontalThumbImage() {
|
|
263
|
+
return this._horizontalBarImage;
|
|
264
|
+
}
|
|
265
|
+
set horizontalThumbImage(value) {
|
|
266
|
+
if (this._horizontalBarImage === value) {
|
|
267
|
+
return;
|
|
268
|
+
}
|
|
269
|
+
this._horizontalBarImage = value;
|
|
270
|
+
const hb = this._horizontalBar;
|
|
271
|
+
hb.thumbImage = value;
|
|
272
|
+
}
|
|
273
|
+
/** Gets or sets the vertical bar image */
|
|
274
|
+
get verticalThumbImage() {
|
|
275
|
+
return this._verticalBarImage;
|
|
276
|
+
}
|
|
277
|
+
set verticalThumbImage(value) {
|
|
278
|
+
if (this._verticalBarImage === value) {
|
|
279
|
+
return;
|
|
280
|
+
}
|
|
281
|
+
this._verticalBarImage = value;
|
|
282
|
+
const vb = this._verticalBar;
|
|
283
|
+
vb.thumbImage = value;
|
|
284
|
+
}
|
|
285
|
+
/** Gets or sets the size of the bar */
|
|
286
|
+
get barSize() {
|
|
287
|
+
return this._barSize;
|
|
288
|
+
}
|
|
289
|
+
set barSize(value) {
|
|
290
|
+
if (this._barSize === value) {
|
|
291
|
+
return;
|
|
292
|
+
}
|
|
293
|
+
this._barSize = value;
|
|
294
|
+
this._markAsDirty();
|
|
295
|
+
if (this._horizontalBar.isVisible) {
|
|
296
|
+
this._grid.setRowDefinition(1, this._barSize, true);
|
|
297
|
+
}
|
|
298
|
+
if (this._verticalBar.isVisible) {
|
|
299
|
+
this._grid.setColumnDefinition(1, this._barSize, true);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
/** Gets or sets the length of the thumb */
|
|
303
|
+
get thumbLength() {
|
|
304
|
+
return this._thumbLength;
|
|
305
|
+
}
|
|
306
|
+
set thumbLength(value) {
|
|
307
|
+
if (this._thumbLength === value) {
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
if (value <= 0) {
|
|
311
|
+
value = 0.1;
|
|
312
|
+
}
|
|
313
|
+
if (value > 1) {
|
|
314
|
+
value = 1;
|
|
315
|
+
}
|
|
316
|
+
this._thumbLength = value;
|
|
317
|
+
const hb = this._horizontalBar;
|
|
318
|
+
const vb = this._verticalBar;
|
|
319
|
+
hb.thumbLength = value;
|
|
320
|
+
vb.thumbLength = value;
|
|
321
|
+
this._markAsDirty();
|
|
322
|
+
}
|
|
323
|
+
/** Gets or sets the height of the thumb */
|
|
324
|
+
get thumbHeight() {
|
|
325
|
+
return this._thumbHeight;
|
|
326
|
+
}
|
|
327
|
+
set thumbHeight(value) {
|
|
328
|
+
if (this._thumbHeight === value) {
|
|
329
|
+
return;
|
|
330
|
+
}
|
|
331
|
+
if (value <= 0) {
|
|
332
|
+
value = 0.1;
|
|
333
|
+
}
|
|
334
|
+
if (value > 1) {
|
|
335
|
+
value = 1;
|
|
336
|
+
}
|
|
337
|
+
this._thumbHeight = value;
|
|
338
|
+
const hb = this._horizontalBar;
|
|
339
|
+
const vb = this._verticalBar;
|
|
340
|
+
hb.thumbHeight = value;
|
|
341
|
+
vb.thumbHeight = value;
|
|
342
|
+
this._markAsDirty();
|
|
343
|
+
}
|
|
344
|
+
/** Gets or sets the height of the bar image */
|
|
345
|
+
get barImageHeight() {
|
|
346
|
+
return this._barImageHeight;
|
|
347
|
+
}
|
|
348
|
+
set barImageHeight(value) {
|
|
349
|
+
if (this._barImageHeight === value) {
|
|
350
|
+
return;
|
|
351
|
+
}
|
|
352
|
+
if (value <= 0) {
|
|
353
|
+
value = 0.1;
|
|
354
|
+
}
|
|
355
|
+
if (value > 1) {
|
|
356
|
+
value = 1;
|
|
357
|
+
}
|
|
358
|
+
this._barImageHeight = value;
|
|
359
|
+
const hb = this._horizontalBar;
|
|
360
|
+
const vb = this._verticalBar;
|
|
361
|
+
hb.barImageHeight = value;
|
|
362
|
+
vb.barImageHeight = value;
|
|
363
|
+
this._markAsDirty();
|
|
364
|
+
}
|
|
365
|
+
/** Gets or sets the height of the horizontal bar image */
|
|
366
|
+
get horizontalBarImageHeight() {
|
|
367
|
+
return this._horizontalBarImageHeight;
|
|
368
|
+
}
|
|
369
|
+
set horizontalBarImageHeight(value) {
|
|
370
|
+
if (this._horizontalBarImageHeight === value) {
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
if (value <= 0) {
|
|
374
|
+
value = 0.1;
|
|
375
|
+
}
|
|
376
|
+
if (value > 1) {
|
|
377
|
+
value = 1;
|
|
378
|
+
}
|
|
379
|
+
this._horizontalBarImageHeight = value;
|
|
380
|
+
const hb = this._horizontalBar;
|
|
381
|
+
hb.barImageHeight = value;
|
|
382
|
+
this._markAsDirty();
|
|
383
|
+
}
|
|
384
|
+
/** Gets or sets the height of the vertical bar image */
|
|
385
|
+
get verticalBarImageHeight() {
|
|
386
|
+
return this._verticalBarImageHeight;
|
|
387
|
+
}
|
|
388
|
+
set verticalBarImageHeight(value) {
|
|
389
|
+
if (this._verticalBarImageHeight === value) {
|
|
390
|
+
return;
|
|
391
|
+
}
|
|
392
|
+
if (value <= 0) {
|
|
393
|
+
value = 0.1;
|
|
394
|
+
}
|
|
395
|
+
if (value > 1) {
|
|
396
|
+
value = 1;
|
|
397
|
+
}
|
|
398
|
+
this._verticalBarImageHeight = value;
|
|
399
|
+
const vb = this._verticalBar;
|
|
400
|
+
vb.barImageHeight = value;
|
|
401
|
+
this._markAsDirty();
|
|
402
|
+
}
|
|
403
|
+
/** Gets or sets the bar background */
|
|
404
|
+
get barBackground() {
|
|
405
|
+
return this._barBackground;
|
|
406
|
+
}
|
|
407
|
+
set barBackground(color) {
|
|
408
|
+
if (this._barBackground === color) {
|
|
409
|
+
return;
|
|
410
|
+
}
|
|
411
|
+
this._barBackground = color;
|
|
412
|
+
const hb = this._horizontalBar;
|
|
413
|
+
const vb = this._verticalBar;
|
|
414
|
+
hb.background = color;
|
|
415
|
+
vb.background = color;
|
|
416
|
+
this._dragSpace.background = color;
|
|
417
|
+
}
|
|
418
|
+
/** Gets or sets the bar background image */
|
|
419
|
+
get barImage() {
|
|
420
|
+
return this._barBackgroundImage;
|
|
421
|
+
}
|
|
422
|
+
set barImage(value) {
|
|
423
|
+
this._barBackgroundImage = value;
|
|
424
|
+
const hb = this._horizontalBar;
|
|
425
|
+
const vb = this._verticalBar;
|
|
426
|
+
hb.backgroundImage = value;
|
|
427
|
+
vb.backgroundImage = value;
|
|
428
|
+
}
|
|
429
|
+
/** Gets or sets the horizontal bar background image */
|
|
430
|
+
get horizontalBarImage() {
|
|
431
|
+
return this._horizontalBarBackgroundImage;
|
|
432
|
+
}
|
|
433
|
+
set horizontalBarImage(value) {
|
|
434
|
+
this._horizontalBarBackgroundImage = value;
|
|
435
|
+
const hb = this._horizontalBar;
|
|
436
|
+
hb.backgroundImage = value;
|
|
437
|
+
}
|
|
438
|
+
/** Gets or sets the vertical bar background image */
|
|
439
|
+
get verticalBarImage() {
|
|
440
|
+
return this._verticalBarBackgroundImage;
|
|
441
|
+
}
|
|
442
|
+
set verticalBarImage(value) {
|
|
443
|
+
this._verticalBarBackgroundImage = value;
|
|
444
|
+
const vb = this._verticalBar;
|
|
445
|
+
vb.backgroundImage = value;
|
|
446
|
+
}
|
|
447
|
+
_setWindowPosition(force = true) {
|
|
448
|
+
const ratio = this.host.idealRatio;
|
|
449
|
+
const windowContentsWidth = this._window._currentMeasure.width;
|
|
450
|
+
const windowContentsHeight = this._window._currentMeasure.height;
|
|
551
451
|
if (!force && this._oldWindowContentsWidth === windowContentsWidth && this._oldWindowContentsHeight === windowContentsHeight) {
|
|
552
452
|
return;
|
|
553
453
|
}
|
|
554
454
|
this._oldWindowContentsWidth = windowContentsWidth;
|
|
555
455
|
this._oldWindowContentsHeight = windowContentsHeight;
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
456
|
+
const _endLeft = this._clientWidth - windowContentsWidth;
|
|
457
|
+
const _endTop = this._clientHeight - windowContentsHeight;
|
|
458
|
+
const newLeft = (this._horizontalBar.value / ratio) * _endLeft + "px";
|
|
459
|
+
const newTop = (this._verticalBar.value / ratio) * _endTop + "px";
|
|
560
460
|
if (newLeft !== this._window.left) {
|
|
561
461
|
this._window.left = newLeft;
|
|
562
462
|
if (!this.freezeControls) {
|
|
@@ -569,11 +469,11 @@ var ScrollViewer = /** @class */ (function (_super) {
|
|
|
569
469
|
this._rebuildLayout = true;
|
|
570
470
|
}
|
|
571
471
|
}
|
|
572
|
-
}
|
|
472
|
+
}
|
|
573
473
|
/** @hidden */
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
474
|
+
_updateScroller() {
|
|
475
|
+
const windowContentsWidth = this._window._currentMeasure.width;
|
|
476
|
+
const windowContentsHeight = this._window._currentMeasure.height;
|
|
577
477
|
if (this._horizontalBar.isVisible && windowContentsWidth <= this._clientWidth && !this.forceHorizontalBar) {
|
|
578
478
|
this._grid.setRowDefinition(1, 0, true);
|
|
579
479
|
this._horizontalBar.isVisible = false;
|
|
@@ -597,14 +497,14 @@ var ScrollViewer = /** @class */ (function (_super) {
|
|
|
597
497
|
this._rebuildLayout = true;
|
|
598
498
|
}
|
|
599
499
|
this._buildClientSizes();
|
|
600
|
-
|
|
500
|
+
const ratio = this.host.idealRatio;
|
|
601
501
|
this._horizontalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientWidth / ratio) + "px";
|
|
602
502
|
this._verticalBar.thumbWidth = this._thumbLength * 0.9 * (this._clientHeight / ratio) + "px";
|
|
603
|
-
}
|
|
604
|
-
|
|
605
|
-
|
|
503
|
+
}
|
|
504
|
+
_link(host) {
|
|
505
|
+
super._link(host);
|
|
606
506
|
this._attachWheel();
|
|
607
|
-
}
|
|
507
|
+
}
|
|
608
508
|
/**
|
|
609
509
|
* @param barControl
|
|
610
510
|
* @param barContainer
|
|
@@ -612,8 +512,7 @@ var ScrollViewer = /** @class */ (function (_super) {
|
|
|
612
512
|
* @param rotation
|
|
613
513
|
* @hidden
|
|
614
514
|
*/
|
|
615
|
-
|
|
616
|
-
var _this = this;
|
|
515
|
+
_addBar(barControl, barContainer, isVertical, rotation) {
|
|
617
516
|
barControl.paddingLeft = 0;
|
|
618
517
|
barControl.width = "100%";
|
|
619
518
|
barControl.height = "100%";
|
|
@@ -626,69 +525,66 @@ var ScrollViewer = /** @class */ (function (_super) {
|
|
|
626
525
|
barControl.rotation = rotation;
|
|
627
526
|
barControl.isVisible = false;
|
|
628
527
|
barContainer.addControl(barControl);
|
|
629
|
-
barControl.onValueChangedObservable.add(
|
|
630
|
-
|
|
528
|
+
barControl.onValueChangedObservable.add(() => {
|
|
529
|
+
this._setWindowPosition();
|
|
631
530
|
});
|
|
632
|
-
}
|
|
531
|
+
}
|
|
633
532
|
/** @hidden */
|
|
634
|
-
|
|
635
|
-
var _this = this;
|
|
533
|
+
_attachWheel() {
|
|
636
534
|
if (!this._host || this._onWheelObserver) {
|
|
637
535
|
return;
|
|
638
536
|
}
|
|
639
|
-
this._onWheelObserver = this.onWheelObservable.add(
|
|
640
|
-
if (!
|
|
537
|
+
this._onWheelObserver = this.onWheelObservable.add((pi) => {
|
|
538
|
+
if (!this._pointerIsOver || this.isReadOnly) {
|
|
641
539
|
return;
|
|
642
540
|
}
|
|
643
|
-
if (
|
|
644
|
-
if (pi.y < 0 &&
|
|
645
|
-
|
|
541
|
+
if (this._verticalBar.isVisible == true) {
|
|
542
|
+
if (pi.y < 0 && this._verticalBar.value > 0) {
|
|
543
|
+
this._verticalBar.value -= this._wheelPrecision;
|
|
646
544
|
}
|
|
647
|
-
else if (pi.y > 0 &&
|
|
648
|
-
|
|
545
|
+
else if (pi.y > 0 && this._verticalBar.value < this._verticalBar.maximum) {
|
|
546
|
+
this._verticalBar.value += this._wheelPrecision;
|
|
649
547
|
}
|
|
650
548
|
}
|
|
651
|
-
if (
|
|
652
|
-
if (pi.x < 0 &&
|
|
653
|
-
|
|
549
|
+
if (this._horizontalBar.isVisible == true) {
|
|
550
|
+
if (pi.x < 0 && this._horizontalBar.value < this._horizontalBar.maximum) {
|
|
551
|
+
this._horizontalBar.value += this._wheelPrecision;
|
|
654
552
|
}
|
|
655
|
-
else if (pi.x > 0 &&
|
|
656
|
-
|
|
553
|
+
else if (pi.x > 0 && this._horizontalBar.value > 0) {
|
|
554
|
+
this._horizontalBar.value -= this._wheelPrecision;
|
|
657
555
|
}
|
|
658
556
|
}
|
|
659
557
|
});
|
|
660
|
-
}
|
|
661
|
-
|
|
558
|
+
}
|
|
559
|
+
_renderHighlightSpecific(context) {
|
|
662
560
|
if (!this.isHighlighted) {
|
|
663
561
|
return;
|
|
664
562
|
}
|
|
665
|
-
|
|
563
|
+
super._renderHighlightSpecific(context);
|
|
666
564
|
this._grid._renderHighlightSpecific(context);
|
|
667
565
|
context.restore();
|
|
668
|
-
}
|
|
566
|
+
}
|
|
669
567
|
/** Releases associated resources */
|
|
670
|
-
|
|
568
|
+
dispose() {
|
|
671
569
|
this.onWheelObservable.remove(this._onWheelObserver);
|
|
672
570
|
this._onWheelObserver = null;
|
|
673
|
-
|
|
674
|
-
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
}(Rectangle));
|
|
692
|
-
export { ScrollViewer };
|
|
571
|
+
super.dispose();
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
__decorate([
|
|
575
|
+
serialize()
|
|
576
|
+
], ScrollViewer.prototype, "wheelPrecision", null);
|
|
577
|
+
__decorate([
|
|
578
|
+
serialize()
|
|
579
|
+
], ScrollViewer.prototype, "scrollBackground", null);
|
|
580
|
+
__decorate([
|
|
581
|
+
serialize()
|
|
582
|
+
], ScrollViewer.prototype, "barColor", null);
|
|
583
|
+
__decorate([
|
|
584
|
+
serialize()
|
|
585
|
+
], ScrollViewer.prototype, "barSize", null);
|
|
586
|
+
__decorate([
|
|
587
|
+
serialize()
|
|
588
|
+
], ScrollViewer.prototype, "barBackground", null);
|
|
693
589
|
RegisterClass("BABYLON.GUI.ScrollViewer", ScrollViewer);
|
|
694
590
|
//# sourceMappingURL=scrollViewer.js.map
|