Prechádzať zdrojové kódy

关联空间最大值时无法缩放

caodongdong 1 rok pred
rodič
commit
9265fc1513
1 zmenil súbory, kde vykonal 13 pridanie a 1 odobranie
  1. 13 1
      src/pages/webgl_rxdz/webgl_rxdz.vue

+ 13 - 1
src/pages/webgl_rxdz/webgl_rxdz.vue

@@ -1261,10 +1261,20 @@
 							break;
 						}
 					}else{
+						console.log("排查右边空间",newWidth, element.spaceWidthMax,newWidth, element.spaceWidthMin);
 						if(newWidth > element.spaceWidthMax || newWidth < element.spaceWidthMin){
 							result = false;
 							space = element;
-							const newWidthValue = newWidth > element.spaceWidthMax ? element.spaceWidthMax : element.spaceWidthMin
+							let newWidthValue = newWidth > element.spaceWidthMax ? element.spaceWidthMax : element.spaceWidthMin
+							if(isZoomIn){ // 放大
+								if(newWidth>element.spaceWidthMax){
+									newValue = 0
+									break;
+								}
+							}else{
+								newWidthValue = newWidth < element.spaceWidthMin ? element.spaceWidthMin : newWidth;
+								console.log("排查右边空间2",newWidth, element.spaceWidthMax, element.spaceWidthMin);
+							}
 							newWidth = newWidthValue - newWidth;
 							const newChangeValue = changeValue - newWidth;
 							if(newValue > newChangeValue){
@@ -1274,6 +1284,8 @@
 						}
 					}
 				}
+				
+				console.log("排查右边空间3", newValue);
 				if(!result){
 					this.$message.warning(`关联空间[${ space && space.spaceName || ''}]达到极限值`);
 				}