diff --git a/panorama-viewer.js b/panorama-viewer.js index e29f506..458abcc 100644 --- a/panorama-viewer.js +++ b/panorama-viewer.js @@ -159,6 +159,11 @@ case "mousemove": θy += event.movementX * 0.005; θx += event.movementY * 0.005; + if (θx < -Math.PI / 2) { + θx = -Math.PI / 2; + } else if (θx > Math.PI / 2) { + θx = Math.PI / 2; + } break } return PanState.panning;