diff --git a/src/scripts/Components/BaseCanvas.js b/src/scripts/Components/BaseCanvas.js index d94346a..17cee34 100644 --- a/src/scripts/Components/BaseCanvas.js +++ b/src/scripts/Components/BaseCanvas.js @@ -227,15 +227,12 @@ class BaseCanvas extends Component{ const clientY = event.clientY || event.touches && event.touches[0].clientY; if(this.options.MouseEnable && typeof clientX !== "undefined" && typeof clientY !== "undefined") { - if(this.options.clickAndDrag){ - if(this._mouseDown){ - this._lon = ( this._mouseDownPointer.x - clientX ) * 0.2 + this._mouseDownLocation.Lon; - this._lat = ( clientY - this._mouseDownPointer.y ) * 0.2 + this._mouseDownLocation.Lat; - this._accelector.x = 0; - this._accelector.y = 0; - } - //do nothing if mouse down is not detected. - }else{ + if(this._mouseDown){ + this._lon = ( this._mouseDownPointer.x - clientX ) * 0.2 + this._mouseDownLocation.Lon; + this._lat = ( clientY - this._mouseDownPointer.y ) * 0.2 + this._mouseDownLocation.Lat; + this._accelector.x = 0; + this._accelector.y = 0; + }else if(!this.options.clickAndDrag){ var rect = this.el().getBoundingClientRect(); const x = clientX - this._width / 2 - rect.left; const y = this._height / 2 - (clientY - rect.top); diff --git a/src/scripts/Panorama.js b/src/scripts/Panorama.js index 7e12d6c..4db0f2c 100644 --- a/src/scripts/Panorama.js +++ b/src/scripts/Panorama.js @@ -22,12 +22,12 @@ const videoTypes = ["equirectangular", "fisheye", "dual_fisheye", "VR1803D", "VR export const defaults: Settings = { videoType: "equirectangular", MouseEnable: true, - clickAndDrag: true, + clickAndDrag: false, movingSpeed: { x: 0.0005, y: 0.0005 }, - clickToToggle: false, + clickToToggle: true, scrollable: true, resizable: true, useHelperCanvas: "auto", @@ -110,6 +110,8 @@ export const VR180Defaults: any = { minLon: 50, maxLon: 130, + + clickAndDrag: true }; /**