This website works better with JavaScript.
Home
Help
Sign In
heuzef
/
pannellum
mirror of
https://github.com/mpetroff/pannellum.git
Watch
1
Star
0
Fork
0
Code
Issues
0
Releases
22
Wiki
Activity
Browse Source
Fix yaw out of bounds in `mouseEventToCoords`.
If `config.yaw` is close to -180 or 180, `yaw` might be out of bounds.
pull/452/head
Tortila90
7 years ago
committed by
Matthew Petroff
parent
c89710c031
commit
7c162a039c
1 changed files
with
4 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+4
-0
src/js/pannellum.js
+ 4
- 0
src/js/pannellum.js
View File
@@ -704,6 +704,10 @@ function mouseEventToCoords(event) {
var root = Math.sqrt(x*x + a*a);
var pitch = Math.atan((y * c + focal * s) / root) * 180 / Math.PI;
var yaw = Math.atan2(x / root, a / root) * 180 / Math.PI + config.yaw;
if (yaw < -180)
yaw += 360;
if (yaw > 180)
yaw -= 360;
return [pitch, yaw];
}
Write
Preview
Loading…
Cancel
Save