|
@@ -150,7 +150,7 @@
|
|
|
console.log("***onLoad-webgl_rxdz***", this.$route.query)
|
|
|
var that = this;
|
|
|
this.houseId = this.$store.state.houseId || '';
|
|
|
- this.childLayout = '0';//4-测试户型
|
|
|
+ this.childLayout = '4';//4-测试户型
|
|
|
let unit = window.screen.width / 750;//单位rpm 对应 px 的值
|
|
|
that.canvasHeight = window.screen.height - (200 * unit) + (20 * unit);
|
|
|
|
|
@@ -931,21 +931,28 @@
|
|
|
const newArea = oldArea + changeArea * (data.isZoomIn ? 1 : -1);
|
|
|
const sizeScale = Math.sqrt(newArea/oldArea) ;
|
|
|
|
|
|
+ // 新的宽度
|
|
|
let newWidth = curSpace.spaceWidth * sizeScale;
|
|
|
- let newHeight = curSpace.spaceHeight * sizeScale;
|
|
|
|
|
|
- if(isZoomIn){
|
|
|
- newWidth = Math.min(newWidth, curSpace.spaceWidthMax)
|
|
|
- newHeight = Math.min(newHeight, curSpace.spaceHeightMax)
|
|
|
- }else{
|
|
|
- newWidth = Math.max(newWidth, curSpace.spaceWidthMin)
|
|
|
- newHeight = Math.max(newHeight, curSpace.spaceHeightMin)
|
|
|
+ if(newWidth < curSpace.spaceWidthMin){
|
|
|
+ newWidth = curSpace.spaceWidthMin
|
|
|
+ }
|
|
|
+ if(newWidth > curSpace.spaceWidthMax){
|
|
|
+ newWidth = curSpace.spaceWidthMax
|
|
|
+ }
|
|
|
+ // 新的高度
|
|
|
+ let newHeight = newArea * 10000 / newWidth;
|
|
|
+
|
|
|
+ if(newHeight < curSpace.spaceHeightMin){
|
|
|
+ newHeight = curSpace.spaceHeightMin
|
|
|
+ }
|
|
|
+ if(newHeight > curSpace.spaceHeightMax){
|
|
|
+ newHeight = curSpace.spaceHeightMax
|
|
|
}
|
|
|
|
|
|
let changeWidth = Math.abs(newWidth - curSpace.spaceWidth)
|
|
|
let changeHeight = Math.abs(newHeight - curSpace.spaceHeight)
|
|
|
-
|
|
|
- console.log("变化的尺寸", newWidth, newHeight, data, sizeScale);
|
|
|
+
|
|
|
console.log("变化的尺寸", changeWidth, changeHeight, data, curSpace.spaceWidth, curSpace.spaceHeight);
|
|
|
|
|
|
if(curSpace.quadrant == 1){
|