Quellcode durchsuchen

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 vor 8 Jahren
Ursprung
Commit
f32badcd0a
1 geänderte Dateien mit 9 neuen und 6 gelöschten Zeilen
  1. +9
    -6
      src/js/pannellum.js

+ 9
- 6
src/js/pannellum.js Datei anzeigen

@@ -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 {


Laden…
Abbrechen
Speichern