xzw 1 год назад
Родитель
Сommit
bfb80086e8

+ 19 - 5
src/custom/materials/postprocessing/EffectComposer.js

@@ -170,19 +170,33 @@ Object.assign(  EffectComposer.prototype, {
 
 		this.writeBuffer = this.renderTarget1;
 		this.readBuffer = this.renderTarget2;
-
+ 
 	},
 
 	setSize: function ( width, height, scaleRatio ) {
-
+ 
         scaleRatio = scaleRatio || this.scaleRatio || 1;
         //console.log('setSize', width * scaleRatio, height * scaleRatio)
-		this.renderTarget1.setSize( width * scaleRatio , height * scaleRatio );
-		this.renderTarget2.setSize( width * scaleRatio, height * scaleRatio );
+        let maxTexWidth = 8192
+        let w = width * scaleRatio
+        let h = height * scaleRatio
+        if(w > maxTexWidth || h > maxTexWidth){ //超出会崩溃
+            if(w>h){
+                scaleRatio = maxTexWidth / width
+            }else{
+                scaleRatio = maxTexWidth / height
+            } 
+        } 
+        w = width * scaleRatio
+        h = height * scaleRatio
+        
+        
+		this.renderTarget1.setSize( w, h );
+		this.renderTarget2.setSize( w, h );
 
 		for ( var i = 0; i < this.passes.length; i ++ ) {
 
-			this.passes[ i ].setSize( width * scaleRatio, height * scaleRatio  );
+			this.passes[ i ].setSize( w, h );
 
 		}
 

+ 1 - 1
src/custom/objects/tool/ctrlPolygon.js

@@ -453,7 +453,7 @@ export class ctrlPolygon extends THREE.Object3D {
                 || !e.isAtDomElement && this.isNew//如果是刚添加时在其他dom点击, 不要响应
                 ||  e.hoverViewport != viewer.mainViewport && this.unableDragAtMap //垂直的测量线不允许在地图上放点
                 || this.isNew && !getDifferentPoint(this.points, this.points.length )   //不允许和之前的点相同, 但这句在点云稀疏时会导致难结束 
-                || this.isNew && (Date.now() - this.beginAddTime) < Potree.config.clickMaxPressTime && e.pressDistance < Potree.config.clickMaxDragDis/* &&  e.pressTime<Potree.config.clickMaxPressTime */  //有的设备过于灵敏,点击一下就结束测量了,是因为滑动了被判断为拖拽。所以判断下如果滑动距离过近不时间过短就算单击
+                || this.isNew && (Date.now() - this.beginAddTime) < Potree.config.clickMaxPressTime/5 && e.pressDistance < Potree.config.clickMaxDragDis/* &&  e.pressTime<Potree.config.clickMaxPressTime */  //有的设备过于灵敏,点击一下就结束测量了,是因为滑动了被判断为拖拽。所以判断下如果滑动距离过近不时间过短就算单击
      
             ) 
         ){

+ 1 - 1
src/custom/settings.js

@@ -284,7 +284,7 @@ const config = {//配置参数   不可修改
     ultraHighQualityMaxZoom: 3,
     panoFieldRadius : 10, //当前位置多远范围内可以切全景模式
     clickMaxDragDis:5,
-    clickMaxPressTime:100, //ms  设置过大的话,点击两下不会触发完成
+    clickMaxPressTime:500, //ms  
     doubleClickTime:200,//双击间隔时间
     testNodeCount1: browser.isMobile() ? 5 : 3,  //testMaxNode次数达到这个数字时,changePointSize才使用nodeMaxLevel。 (调试时比较卡,在线上实际只需要3)