fix: 修复回放模式下机器人笔的可见性和解锁状态设置,确保能够正确聚焦到指定机器人

This commit is contained in:
xudan 2025-10-13 10:58:34 +08:00
parent f14e3a68ad
commit b7db343ba7

View File

@ -476,6 +476,20 @@ const isArea = computed(() => current.value?.type === 'area');
const selectRobot = (id: string) => {
current.value = { type: 'robot', id };
editor.value?.inactive();
// [FIX] In playback mode, robot pens might not be correctly set as visible or unlocked.
// This ensures that gotoById can focus on the robot.
if (isPlaybackMode.value) {
editor.value?.setValue(
{
id,
visible: true,
locked: LockState.None,
},
{ render: false, history: false },
);
}
//
editor.value?.gotoById(id);
};