Skip to content

Commit

Permalink
Zero out roll when stopOrientation is called (fixes #1230).
Browse files Browse the repository at this point in the history
Previously, all the internal calls to `stopOrientation` were followed by
setting the roll to zero, but this was not done when the function was called
via the API. As this roll parameter is only used for device orientation
control, there's no API method to change it, so it was previously not possible
to zero out the roll when device orientation control was stopped using
the API.
  • Loading branch information
mpetroff committed Aug 21, 2024
1 parent bbf97c8 commit fde3fbd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/js/pannellum.js
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,6 @@ function onDocumentMouseDown(event) {
stopAnimation();

stopOrientation();
config.roll = 0;

speed.hfov = 0;

Expand Down Expand Up @@ -932,7 +931,6 @@ function onDocumentTouchStart(event) {
stopAnimation();

stopOrientation();
config.roll = 0;

speed.hfov = 0;

Expand Down Expand Up @@ -1181,7 +1179,6 @@ function onDocumentKeyPress(event) {
latestInteraction = Date.now();

stopOrientation();
config.roll = 0;

// Record key pressed
var keynumber = event.which || event.keycode;
Expand Down Expand Up @@ -2569,6 +2566,7 @@ function stopOrientation() {
window.removeEventListener('deviceorientation', orientationListener);
controls.orientation.classList.remove('pnlm-orientation-button-active');
orientation = false;
config.roll = 0;
}

/**
Expand Down

0 comments on commit fde3fbd

Please sign in to comment.