This commit is contained in:
2026-05-19 10:57:28 +08:00
parent 8478d45046
commit 093a671fd7
3 changed files with 9 additions and 3 deletions

View File

@ -31,6 +31,8 @@ export class AppDropZone {
// 存储放置区域配置数据
private dropZoneConfig: DropZoneConfig | null = null;
// 存储原始墙面配置(用于 updateDivisions 时恢复完整墙面列表)
private originalWalls: WallConfig[] = [];
constructor(scene: Scene) {
this.scene = scene;
@ -50,6 +52,8 @@ export class AppDropZone {
*/
setData(config: DropZoneConfig): void {
this.dropZoneConfig = config;
// 保存原始墙面配置的深拷贝
this.originalWalls = config.walls.map(wall => ({ ...wall }));
}
/**
@ -145,8 +149,8 @@ export class AppDropZone {
return null;
};
// 更新配置中的墙面分割数,只保留后端配置的墙面
this.dropZoneConfig.walls = this.dropZoneConfig.walls
// 更新配置中的墙面分割数,从原始配置中恢复墙面列表
this.dropZoneConfig.walls = this.originalWalls
.map(wall => {
const newDivisions = matchWallName(wall.name);