fix: 在选择机器人时聚焦到机器人位置,并增加判断机器人可见性的逻辑

This commit is contained in:
xudan 2025-07-07 16:38:39 +08:00
parent 024e923d31
commit 0285b59927
2 changed files with 4 additions and 0 deletions

View File

@ -89,6 +89,8 @@ const isArea = computed(() => current.value?.type === 'area');
const selectRobot = (id: string) => {
current.value = { type: 'robot', id };
editor.value?.inactive();
//
editor.value?.gotoById(id);
};
//

View File

@ -527,6 +527,8 @@ export class EditorService extends Meta2d {
public gotoById(id: string): void {
const pen = this.getPenById(id);
if (isNil(pen)) return;
// 判断机器人是否可见,如果不可见直接返回
if (pen.visible === false && pen.tags?.includes('robot')) return;
this.gotoView(pen);
}