| | |
| | | adjustedRects.value = data.overGlass[0].map(rect => { |
| | | let adjustedWidth, adjustedHeight, adjustedWidtha, adjustedHeighta; |
| | | if (rect.angle === 90) { |
| | | adjustedWidth = rect.height * 0.3; |
| | | adjustedHeight = rect.width * 0.3; |
| | | adjustedWidth = rect.height * 0.2; |
| | | adjustedHeight = rect.width * 0.2; |
| | | adjustedWidtha = rect.height; |
| | | adjustedHeighta = rect.width; |
| | | } else { |
| | | adjustedWidth = rect.width * 0.3; |
| | | adjustedHeight = rect.height * 0.3; |
| | | adjustedWidth = rect.width * 0.2; |
| | | adjustedHeight = rect.height * 0.2; |
| | | adjustedWidtha = rect.width; |
| | | adjustedHeighta = rect.height; |
| | | } |
| | | return { |
| | | ...rect, // 复制原始对象的其他属性 |
| | | xcoordinate: rect.xCoordinate * 0.3, |
| | | ycoordinate: rect.yCoordinate * 0.3, |
| | | xcoordinate: rect.xCoordinate * 0.2, |
| | | ycoordinate: rect.yCoordinate * 0.2, |
| | | width: adjustedWidth, |
| | | height: adjustedHeight, |
| | | widtha: adjustedWidtha, |