소스 검색

Changed Math.min to Math.max

Using min causes odd errors where you can actually "zoom closer" than your minHfov setting. 

If the calculation for the multi-res minHfov is smaller than the config.minHfov, then you can zoom closer. This can happen when cubeResolution is very large and canvas.width is very small. In my case, my cuberesolution is 6704 and  canvas.width is 1440. My minHfov is 30 but the calculated minHfov is around 21, allowing me to zoom-in more than desired.
pull/640/head
Chase Walden 6 년 전
committed by GitHub
부모
커밋
2babe9783e
No known key found for this signature in database GPG 키 ID: 4AEE18F83AFDEB23
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. +1
    -1
      src/js/pannellum.js

+ 1
- 1
src/js/pannellum.js 파일 보기

@@ -2145,7 +2145,7 @@ function constrainHfov(hfov) {
// Keep field of view within bounds
var minHfov = config.minHfov;
if (config.type == 'multires' && renderer) {
minHfov = Math.min(minHfov, renderer.getCanvas().width / (config.multiRes.cubeResolution / 90 * 0.9));
minHfov = Math.max(minHfov, renderer.getCanvas().width / (config.multiRes.cubeResolution / 90 * 0.9));
}
if (minHfov > config.maxHfov) {
// Don't change view if bounds don't make sense


불러오는 중...
취소
저장