浏览代码

fix: 还报错!

xzw 1 年之前
父节点
当前提交
b958d98580
共有 2 个文件被更改,包括 9 次插入3 次删除
  1. 8 2
      public/static/lib/potree/potree.js
  2. 1 1
      public/static/lib/potree/potree.js.map

+ 8 - 2
public/static/lib/potree/potree.js

@@ -96901,7 +96901,13 @@ ENDSEC
 	            this.canvas.width = img.width; 
 	            this.canvas.height = img.height; 
 	            this.context.drawImage(img, 0, 0); 
-	            let data = this.context.getImageData(0, 0, img.width , img.height ).data;     //getImageData 1px时 : pc chrome 耗时0.01毫秒左右(排除第一次的50) , 但firefox: 4。但换贴图之后就多达5甚至几十  
+	            let o = this.context.getImageData(0, 0, img.width , img.height );
+	            let data = o && o.data;    //getImageData 1px时 : pc chrome 耗时0.01毫秒左右(排除第一次的50) , 但firefox: 4。但换贴图之后就多达5甚至几十  
+	            if(!data){
+	                console.error('getImageData 得不到?!why!');
+	                return false
+	            }
+	            
 	            //console.log('changeImg',pano.id ) 
 	            //this.img = img
 	             
@@ -98665,7 +98671,7 @@ ENDSEC
 	        this.depthSampler.updateNearPanos(panos);
 	        
 	        let maxWaitDur = browser.isMobile() ? 30 : 60;  
-	        let changeCount = 0, maxChangeTex = browser.isMobile() ? 2 : 4, getCount = 0;
+	        let changeCount = 0, maxChangeTex = browser.isMobile() ? 1 : 4, getCount = 0;
 	        let changeTexCount = ()=>{
 	            changeCount ++;
 	        }; 

文件差异内容过多而无法显示
+ 1 - 1
public/static/lib/potree/potree.js.map