babylonjs-gui 5.0.0-rc.0 → 5.0.0-rc.1

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.js CHANGED
@@ -19361,6 +19361,7 @@ var Slider3D = /** @class */ (function (_super) {
19361
19361
  return;
19362
19362
  }
19363
19363
  this._value = Math.max(Math.min(value, this._maximum), this._minimum);
19364
+ this._sliderThumb.position.x = this._convertToPosition(this.value);
19364
19365
  this.onValueChangedObservable.notifyObservers(this._value);
19365
19366
  },
19366
19367
  enumerable: false,
@@ -19481,13 +19482,12 @@ var Slider3D = /** @class */ (function (_super) {
19481
19482
  var _this = this;
19482
19483
  var pointerDragBehavior = new babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["PointerDragBehavior"]({ dragAxis: babylonjs_Misc_observable__WEBPACK_IMPORTED_MODULE_1__["Vector3"].Right() });
19483
19484
  pointerDragBehavior.moveAttached = false;
19484
- pointerDragBehavior.onDragObservable.add(function (event) {
19485
- var newPosition = _this._sliderThumb.position.x + event.dragDistance / _this.scaling.x;
19486
- _this._sliderThumb.position.x = Math.max(Math.min(newPosition, _this.end), _this.start);
19487
- _this.value = _this._convertToValue(_this._sliderThumb.position.x);
19485
+ pointerDragBehavior.onDragStartObservable.add(function (event) {
19486
+ _this._draggedPosition = _this._sliderThumb.position.x;
19488
19487
  });
19489
- pointerDragBehavior.onDragEndObservable.add(function (event) {
19490
- _this._sliderThumb.position.x = _this._convertToPosition(_this.value);
19488
+ pointerDragBehavior.onDragObservable.add(function (event) {
19489
+ _this._draggedPosition += event.dragDistance / _this.scaling.x;
19490
+ _this.value = _this._convertToValue(_this._draggedPosition);
19491
19491
  });
19492
19492
  return pointerDragBehavior;
19493
19493
  };