Bläddra i källkod

Only use multires zoom calculation to increase zoom (not decrease it) and handle case where minimum HFOV is greater than maximum HFOV (fixes #107).

tags/2.2.0
Matthew Petroff 8 år sedan
förälder
incheckning
f32badcd0a
1 ändrade filer med 9 tillägg och 6 borttagningar
  1. +9
    -6
      src/js/pannellum.js

+ 9
- 6
src/js/pannellum.js Visa fil

@@ -1575,12 +1575,15 @@ function zoomOut() {
*/
function setHfov(hfov) {
// Keep field of view within bounds
if (hfov < config.minHfov && config.type != 'multires') {
config.hfov = config.minHfov;
} else if (config.type == 'multires' && renderer && hfov < renderer.getCanvas().width /
(config.multiRes.cubeResolution / 90 * 0.9)) {
config.hfov = renderer.getCanvas().width / (config.multiRes.cubeResolution / 90 * 0.9);
var minHfov = config.minHfov;
if (config.type == 'multires' && renderer) {
minHfov = Math.min(minHfov, renderer.getCanvas().width / (config.multiRes.cubeResolution / 90 * 0.9));
}
if (minHfov >= config.maxHfov) {
// Don't change view if bounds don't make sense
return;
} if (hfov < minHfov) {
config.hfov = minHfov;
} else if (hfov > config.maxHfov) {
config.hfov = config.maxHfov;
} else {


Laddar…
Avbryt
Spara