Skip to content

Commit

Permalink
run build
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew Oxley committed Nov 18, 2021
1 parent d85fe72 commit fba499c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
16 changes: 13 additions & 3 deletions dist/camera-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -526,22 +526,32 @@
}
endDragging_1();
};
var onGestureStart_1 = function () {
var onGestureStart_1 = function (event) {
if (!_this._enabled || _this.mouseButtons.pinch === ACTION.NONE || isTouchScreen)
return;
_this._gesturing = true;
_this._gestureScaleStart = _this._zoom;
event.preventDefault();
};
var onGestureChanged_1 = function (event) {
if (!_this._enabled ||
_this.mouseButtons.pinch === ACTION.NONE ||
isTouchScreen ||
typeof _this._gestureScaleStart !== "number")
return;
_this._getClientRect(_this._elementRect);
var x = _this.dollyToCursor ? (event.clientX - _this._elementRect.x) / _this._elementRect.z * 2 - 1 : 0;
var y = _this.dollyToCursor ? (event.clientY - _this._elementRect.y) / _this._elementRect.w * -2 + 1 : 0;
var FACTOR = 0.5;
if (_this.mouseButtons.pinch === ACTION.ZOOM) {
var newScale = _this._gestureScaleStart * event.scale;
_this.zoomTo(newScale, false);
var to = (1 - event.scale) * FACTOR;
_this._zoomInternal(to, x, y);
}
if (_this.mouseButtons.pinch === ACTION.DOLLY) {
var to = (1 - event.scale) * FACTOR;
_this._dollyInternal(to, x, y);
}
event.preventDefault();
};
var lastScrollTimeStamp_1 = -1;
var onMouseWheel_1 = function (event) {
Expand Down
2 changes: 1 addition & 1 deletion dist/camera-controls.min.js

Large diffs are not rendered by default.

16 changes: 13 additions & 3 deletions dist/camera-controls.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,22 +520,32 @@ var CameraControls = (function (_super) {
}
endDragging_1();
};
var onGestureStart_1 = function () {
var onGestureStart_1 = function (event) {
if (!_this._enabled || _this.mouseButtons.pinch === ACTION.NONE || isTouchScreen)
return;
_this._gesturing = true;
_this._gestureScaleStart = _this._zoom;
event.preventDefault();
};
var onGestureChanged_1 = function (event) {
if (!_this._enabled ||
_this.mouseButtons.pinch === ACTION.NONE ||
isTouchScreen ||
typeof _this._gestureScaleStart !== "number")
return;
_this._getClientRect(_this._elementRect);
var x = _this.dollyToCursor ? (event.clientX - _this._elementRect.x) / _this._elementRect.z * 2 - 1 : 0;
var y = _this.dollyToCursor ? (event.clientY - _this._elementRect.y) / _this._elementRect.w * -2 + 1 : 0;
var FACTOR = 0.5;
if (_this.mouseButtons.pinch === ACTION.ZOOM) {
var newScale = _this._gestureScaleStart * event.scale;
_this.zoomTo(newScale, false);
var to = (1 - event.scale) * FACTOR;
_this._zoomInternal(to, x, y);
}
if (_this.mouseButtons.pinch === ACTION.DOLLY) {
var to = (1 - event.scale) * FACTOR;
_this._dollyInternal(to, x, y);
}
event.preventDefault();
};
var lastScrollTimeStamp_1 = -1;
var onMouseWheel_1 = function (event) {
Expand Down

0 comments on commit fba499c

Please sign in to comment.