diff --git a/doc/json-config-parameters.md b/doc/json-config-parameters.md index 54fcdad..222874c 100644 --- a/doc/json-config-parameters.md +++ b/doc/json-config-parameters.md @@ -362,7 +362,8 @@ by constraining the yaw and the field-of-view. Even at the corners and edges of the canvas only areas actually belonging to the image (i.e., within [`minYaw`, `maxYaw`] and [`minPitch`, `maxPitch`]) are shown, thus setting the `backgroundColor` option is not needed if this option is set. -Defaults to `false`. +Defaults to `false`. The `minPitch` and `maxPitch` parameters must be defined +if this option is enabled. ## `equirectangular` specific options diff --git a/src/js/pannellum.js b/src/js/pannellum.js index 38a6096..e7b22e3 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -1845,6 +1845,16 @@ function createHotSpot(hs) { div.addEventListener('click', function(e) { hs.clickHandlerFunc(e, hs.clickHandlerArgs); }, 'false'); + if (document.documentElement.style.pointerAction === '' && + document.documentElement.style.touchAction === '') { + div.addEventListener('pointerup', function(e) { + hs.clickHandlerFunc(e, hs.clickHandlerArgs); + }, false); + } else { + div.addEventListener('touchend', function(e) { + hs.clickHandlerFunc(e, hs.clickHandlerArgs); + }, false); + } div.className += ' pnlm-pointer'; span.className += ' pnlm-pointer'; } @@ -2306,7 +2316,7 @@ function constrainHfov(hfov) { newHfov = hfov; } // Optionally avoid showing background (empty space) on top or bottom by adapting newHfov - if (config.avoidShowingBackground && renderer) { + if (config.avoidShowingBackground && renderer && !isNaN(config.maxPitch - config.minPitch)) { var canvas = renderer.getCanvas(); newHfov = Math.min(newHfov, Math.atan(Math.tan((config.maxPitch - config.minPitch) / 360 * Math.PI) / diff --git a/utils/multires/generate.py b/utils/multires/generate.py index 38d6d52..d72ab5e 100755 --- a/utils/multires/generate.py +++ b/utils/multires/generate.py @@ -5,7 +5,7 @@ # generate.py - A multires tile set generator for Pannellum # Extensions to cylindrical input and partial panoramas by David von Oheimb -# Copyright (c) 2014-2018 Matthew Petroff +# Copyright (c) 2014-2020 Matthew Petroff # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -246,7 +246,7 @@ if vaov < 180: text.append(' "maxPitch": ' + str(+vaov/2+args.vOffset)+ ',') if colorTuple != (0, 0, 0): text.append(' "backgroundColor": "' + args.backgroundColor+ '",') -if args.avoidbackground: +if args.avoidbackground and (haov < 360 or vaov < 180): text.append(' "avoidShowingBackground": true,') if args.autoload: text.append(' "autoLoad": true,')