xzw 1 年之前
父节点
当前提交
1f8f81f68c
共有 3 个文件被更改,包括 20 次插入3 次删除
  1. 6 2
      src/custom/modules/panos/DepthImageSampler.js
  2. 3 1
      src/custom/objects/tool/Measure.js
  3. 11 0
      改bug的历史.txt

+ 6 - 2
src/custom/modules/panos/DepthImageSampler.js

@@ -50,10 +50,14 @@ class DepthImageSampler extends THREE.EventDispatcher{
             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甚至几十  
             //console.log('changeImg',pano.id ) 
             //this.img = img
-             
+            if(!data){
+                console.error('getImageData 得不到?!why!')
+                return false
+            }
              
             if(this.imgDatas.length >= this.maxDataCount){
                 let old = this.imgDatas.find(e=>!this.nearPanos.includes(e.pano))   

+ 3 - 1
src/custom/objects/tool/Measure.js

@@ -1093,7 +1093,9 @@ export class Measure extends ctrlPolygon{
             prop.showEdges = true, 
             prop.minMarkers = 2 
         }else if(prop.measureType == 'MulDistance Ring'){
-            prop.showEdges = true,
+            prop.showDistances = true,  
+            prop.showEdges = true, 
+            prop.showArea:true,
             prop.closed = true, 
             prop.minMarkers = 3  
         }else if(prop.measureType == 'Ver MulDistance'){ 

+ 11 - 0
改bug的历史.txt

@@ -3,8 +3,19 @@
 
 
 
+2023.12.29
 
 
+DepthImageSampler 
+let data = this.context.getImageData(0, 0, img.width , img.height ).data;  
+怎么还报错呢?!!
+
+(勘测华为平板)
+
+错误1:Failed to execute 'getImageData' on 'CanvasRenderingContext2D': Out of memory at ImageData creation
+
+错误2:cannot read properties of undefined (reading 'data')
+