babylonjs-gui 5.17.1 → 5.20.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/babylon.gui.d.ts +8 -0
- package/babylon.gui.js +56 -8
- package/babylon.gui.js.map +1 -1
- package/babylon.gui.min.js +1 -1
- package/babylon.gui.min.js.map +1 -1
- package/babylon.gui.module.d.ts +16 -0
- package/package.json +2 -2
package/babylon.gui.d.ts
CHANGED
|
@@ -3519,8 +3519,12 @@ declare module BABYLON.GUI {
|
|
|
3519
3519
|
private _thumbHeight;
|
|
3520
3520
|
private _barImageHeight;
|
|
3521
3521
|
private _tempMeasure;
|
|
3522
|
+
private _invertScrollDirection;
|
|
3522
3523
|
/** Number of 90° rotation to apply on the images when in vertical mode */
|
|
3523
3524
|
num90RotationInVerticalMode: number;
|
|
3525
|
+
/** Inverts the scrolling direction (default: false) */
|
|
3526
|
+
get invertScrollDirection(): boolean;
|
|
3527
|
+
set invertScrollDirection(invert: boolean);
|
|
3524
3528
|
/**
|
|
3525
3529
|
* Gets or sets the image used to render the background for horizontal bar
|
|
3526
3530
|
*/
|
|
@@ -3575,12 +3579,16 @@ declare module BABYLON.GUI {
|
|
|
3575
3579
|
private _background;
|
|
3576
3580
|
private _borderColor;
|
|
3577
3581
|
private _tempMeasure;
|
|
3582
|
+
private _invertScrollDirection;
|
|
3578
3583
|
/** Gets or sets border color */
|
|
3579
3584
|
get borderColor(): string;
|
|
3580
3585
|
set borderColor(value: string);
|
|
3581
3586
|
/** Gets or sets background color */
|
|
3582
3587
|
get background(): string;
|
|
3583
3588
|
set background(value: string);
|
|
3589
|
+
/** Inverts the scrolling direction (default: false) */
|
|
3590
|
+
get invertScrollDirection(): boolean;
|
|
3591
|
+
set invertScrollDirection(invert: boolean);
|
|
3584
3592
|
/**
|
|
3585
3593
|
* Creates a new Slider
|
|
3586
3594
|
* @param name defines the control name
|
package/babylon.gui.js
CHANGED
|
@@ -12100,17 +12100,17 @@ var Rectangle = /** @class */ (function (_super) {
|
|
|
12100
12100
|
var y = this._currentMeasure.top + offset;
|
|
12101
12101
|
var width = this._currentMeasure.width - offset * 2;
|
|
12102
12102
|
var height = this._currentMeasure.height - offset * 2;
|
|
12103
|
-
var radius = Math.min(height / 2
|
|
12103
|
+
var radius = Math.min(height / 2, Math.min(width / 2, this._cornerRadius));
|
|
12104
12104
|
context.beginPath();
|
|
12105
12105
|
context.moveTo(x + radius, y);
|
|
12106
12106
|
context.lineTo(x + width - radius, y);
|
|
12107
|
-
context.
|
|
12107
|
+
context.arc(x + width - radius, y + radius, radius, (3 * Math.PI) / 2, Math.PI * 2);
|
|
12108
12108
|
context.lineTo(x + width, y + height - radius);
|
|
12109
|
-
context.
|
|
12109
|
+
context.arc(x + width - radius, y + height - radius, radius, 0, Math.PI / 2);
|
|
12110
12110
|
context.lineTo(x + radius, y + height);
|
|
12111
|
-
context.
|
|
12111
|
+
context.arc(x + radius, y + height - radius, radius, Math.PI / 2, Math.PI);
|
|
12112
12112
|
context.lineTo(x, y + radius);
|
|
12113
|
-
context.
|
|
12113
|
+
context.arc(x + radius, y + radius, radius, Math.PI, (3 * Math.PI) / 2);
|
|
12114
12114
|
context.closePath();
|
|
12115
12115
|
};
|
|
12116
12116
|
Rectangle.prototype._clipForChildren = function (context) {
|
|
@@ -12150,7 +12150,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12150
12150
|
/* harmony import */ var _scrollViewerWindow__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./scrollViewerWindow */ "../../../lts/gui/dist/2D/controls/scrollViewers/scrollViewerWindow.js");
|
|
12151
12151
|
/* harmony import */ var _sliders_scrollBar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../sliders/scrollBar */ "../../../lts/gui/dist/2D/controls/sliders/scrollBar.js");
|
|
12152
12152
|
/* harmony import */ var _sliders_imageScrollBar__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../sliders/imageScrollBar */ "../../../lts/gui/dist/2D/controls/sliders/imageScrollBar.js");
|
|
12153
|
-
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core/Misc/
|
|
12153
|
+
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! core/Misc/decorators */ "core/Misc/observable");
|
|
12154
12154
|
/* harmony import */ var core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_7__);
|
|
12155
12155
|
|
|
12156
12156
|
|
|
@@ -12160,6 +12160,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
12160
12160
|
|
|
12161
12161
|
|
|
12162
12162
|
|
|
12163
|
+
|
|
12163
12164
|
/**
|
|
12164
12165
|
* Class used to hold a viewer window and sliders in a grid
|
|
12165
12166
|
*/
|
|
@@ -12825,6 +12826,21 @@ var ScrollViewer = /** @class */ (function (_super) {
|
|
|
12825
12826
|
this._onWheelObserver = null;
|
|
12826
12827
|
_super.prototype.dispose.call(this);
|
|
12827
12828
|
};
|
|
12829
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
12830
|
+
(0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_7__.serialize)()
|
|
12831
|
+
], ScrollViewer.prototype, "wheelPrecision", null);
|
|
12832
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
12833
|
+
(0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_7__.serialize)()
|
|
12834
|
+
], ScrollViewer.prototype, "scrollBackground", null);
|
|
12835
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
12836
|
+
(0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_7__.serialize)()
|
|
12837
|
+
], ScrollViewer.prototype, "barColor", null);
|
|
12838
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
12839
|
+
(0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_7__.serialize)()
|
|
12840
|
+
], ScrollViewer.prototype, "barSize", null);
|
|
12841
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
12842
|
+
(0,core_Misc_typeStore__WEBPACK_IMPORTED_MODULE_7__.serialize)()
|
|
12843
|
+
], ScrollViewer.prototype, "barBackground", null);
|
|
12828
12844
|
return ScrollViewer;
|
|
12829
12845
|
}(_rectangle__WEBPACK_IMPORTED_MODULE_1__.Rectangle));
|
|
12830
12846
|
|
|
@@ -14462,10 +14478,22 @@ var ImageScrollBar = /** @class */ (function (_super) {
|
|
|
14462
14478
|
_this._thumbHeight = 1;
|
|
14463
14479
|
_this._barImageHeight = 1;
|
|
14464
14480
|
_this._tempMeasure = new _measure__WEBPACK_IMPORTED_MODULE_2__.Measure(0, 0, 0, 0);
|
|
14481
|
+
_this._invertScrollDirection = false;
|
|
14465
14482
|
/** Number of 90° rotation to apply on the images when in vertical mode */
|
|
14466
14483
|
_this.num90RotationInVerticalMode = 1;
|
|
14467
14484
|
return _this;
|
|
14468
14485
|
}
|
|
14486
|
+
Object.defineProperty(ImageScrollBar.prototype, "invertScrollDirection", {
|
|
14487
|
+
/** Inverts the scrolling direction (default: false) */
|
|
14488
|
+
get: function () {
|
|
14489
|
+
return this._invertScrollDirection;
|
|
14490
|
+
},
|
|
14491
|
+
set: function (invert) {
|
|
14492
|
+
this._invertScrollDirection = invert;
|
|
14493
|
+
},
|
|
14494
|
+
enumerable: false,
|
|
14495
|
+
configurable: true
|
|
14496
|
+
});
|
|
14469
14497
|
Object.defineProperty(ImageScrollBar.prototype, "backgroundImage", {
|
|
14470
14498
|
/**
|
|
14471
14499
|
* Gets or sets the image used to render the background for horizontal bar
|
|
@@ -14666,6 +14694,7 @@ var ImageScrollBar = /** @class */ (function (_super) {
|
|
|
14666
14694
|
x = this._transformedPosition.x;
|
|
14667
14695
|
y = this._transformedPosition.y;
|
|
14668
14696
|
}
|
|
14697
|
+
var sign = this._invertScrollDirection ? -1 : 1;
|
|
14669
14698
|
if (this._first) {
|
|
14670
14699
|
this._first = false;
|
|
14671
14700
|
this._originX = x;
|
|
@@ -14691,7 +14720,7 @@ var ImageScrollBar = /** @class */ (function (_super) {
|
|
|
14691
14720
|
else {
|
|
14692
14721
|
delta = (x - this._originX) / (this._currentMeasure.width - this._effectiveThumbThickness);
|
|
14693
14722
|
}
|
|
14694
|
-
this.value += delta * (this.maximum - this.minimum);
|
|
14723
|
+
this.value += sign * delta * (this.maximum - this.minimum);
|
|
14695
14724
|
this._originX = x;
|
|
14696
14725
|
this._originY = y;
|
|
14697
14726
|
};
|
|
@@ -14702,6 +14731,9 @@ var ImageScrollBar = /** @class */ (function (_super) {
|
|
|
14702
14731
|
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
14703
14732
|
(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_3__.serialize)()
|
|
14704
14733
|
], ImageScrollBar.prototype, "num90RotationInVerticalMode", void 0);
|
|
14734
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
14735
|
+
(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_3__.serialize)()
|
|
14736
|
+
], ImageScrollBar.prototype, "invertScrollDirection", null);
|
|
14705
14737
|
return ImageScrollBar;
|
|
14706
14738
|
}(_baseSlider__WEBPACK_IMPORTED_MODULE_1__.BaseSlider));
|
|
14707
14739
|
|
|
@@ -14743,6 +14775,7 @@ var ScrollBar = /** @class */ (function (_super) {
|
|
|
14743
14775
|
_this._background = "black";
|
|
14744
14776
|
_this._borderColor = "white";
|
|
14745
14777
|
_this._tempMeasure = new _measure__WEBPACK_IMPORTED_MODULE_2__.Measure(0, 0, 0, 0);
|
|
14778
|
+
_this._invertScrollDirection = false;
|
|
14746
14779
|
return _this;
|
|
14747
14780
|
}
|
|
14748
14781
|
Object.defineProperty(ScrollBar.prototype, "borderColor", {
|
|
@@ -14775,6 +14808,17 @@ var ScrollBar = /** @class */ (function (_super) {
|
|
|
14775
14808
|
enumerable: false,
|
|
14776
14809
|
configurable: true
|
|
14777
14810
|
});
|
|
14811
|
+
Object.defineProperty(ScrollBar.prototype, "invertScrollDirection", {
|
|
14812
|
+
/** Inverts the scrolling direction (default: false) */
|
|
14813
|
+
get: function () {
|
|
14814
|
+
return this._invertScrollDirection;
|
|
14815
|
+
},
|
|
14816
|
+
set: function (invert) {
|
|
14817
|
+
this._invertScrollDirection = invert;
|
|
14818
|
+
},
|
|
14819
|
+
enumerable: false,
|
|
14820
|
+
configurable: true
|
|
14821
|
+
});
|
|
14778
14822
|
ScrollBar.prototype._getTypeName = function () {
|
|
14779
14823
|
return "Scrollbar";
|
|
14780
14824
|
};
|
|
@@ -14825,6 +14869,7 @@ var ScrollBar = /** @class */ (function (_super) {
|
|
|
14825
14869
|
x = this._transformedPosition.x;
|
|
14826
14870
|
y = this._transformedPosition.y;
|
|
14827
14871
|
}
|
|
14872
|
+
var sign = this._invertScrollDirection ? -1 : 1;
|
|
14828
14873
|
if (this._first) {
|
|
14829
14874
|
this._first = false;
|
|
14830
14875
|
this._originX = x;
|
|
@@ -14850,7 +14895,7 @@ var ScrollBar = /** @class */ (function (_super) {
|
|
|
14850
14895
|
else {
|
|
14851
14896
|
delta = (x - this._originX) / (this._currentMeasure.width - this._effectiveThumbThickness);
|
|
14852
14897
|
}
|
|
14853
|
-
this.value += delta * (this.maximum - this.minimum);
|
|
14898
|
+
this.value += sign * delta * (this.maximum - this.minimum);
|
|
14854
14899
|
this._originX = x;
|
|
14855
14900
|
this._originY = y;
|
|
14856
14901
|
};
|
|
@@ -14864,6 +14909,9 @@ var ScrollBar = /** @class */ (function (_super) {
|
|
|
14864
14909
|
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
14865
14910
|
(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_3__.serialize)()
|
|
14866
14911
|
], ScrollBar.prototype, "background", null);
|
|
14912
|
+
(0,tslib__WEBPACK_IMPORTED_MODULE_0__.__decorate)([
|
|
14913
|
+
(0,core_Misc_decorators__WEBPACK_IMPORTED_MODULE_3__.serialize)()
|
|
14914
|
+
], ScrollBar.prototype, "invertScrollDirection", null);
|
|
14867
14915
|
return ScrollBar;
|
|
14868
14916
|
}(_baseSlider__WEBPACK_IMPORTED_MODULE_1__.BaseSlider));
|
|
14869
14917
|
|