Browse Source

Fix for #516

pull/723/head
Gareth Hay 5 years ago
parent
commit
9260733fd3
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/js/pannellum.js

+ 3
- 3
src/js/pannellum.js View File

@@ -2471,7 +2471,7 @@ this.setYaw = function(yaw, animated, callback, callbackArgs) {
return this;
}
animated = animated == undefined ? 1000: Number(animated);
yaw = ((yaw + 180) % 360) - 180 // Keep in bounds
yaw = (yaw>180)?yaw-360:(yaw<-180)?yaw=yaw+360:yaw;
if (animated) {
// Animate in shortest direction
if (config.yaw - yaw > 180)
@@ -2482,13 +2482,13 @@ this.setYaw = function(yaw, animated, callback, callbackArgs) {
animatedMove.yaw = {
'startTime': Date.now(),
'startPosition': config.yaw,
'endPosition': yaw,
'endPosition': parseFloat(yaw),
'duration': animated
}
if (typeof callback == 'function')
setTimeout(function(){callback(callbackArgs)}, animated);
} else {
config.yaw = yaw;
config.yaw = parseFloat(yaw);
}
animateInit();
return this;


Loading…
Cancel
Save