fix: 在选择机器人时聚焦到机器人位置,并增加判断机器人可见性的逻辑
This commit is contained in:
parent
024e923d31
commit
0285b59927
@ -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);
|
||||
};
|
||||
|
||||
// 视图状态管理
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user