fix: 修复存储位置服务监控调用,优化锁定图标的显示属性和样式

This commit is contained in:
xudan 2025-07-29 14:11:33 +08:00
parent 8ab88e9818
commit e3c0788e0b
2 changed files with 9 additions and 8 deletions

View File

@ -138,7 +138,7 @@ onMounted(async () => {
await readScene(); await readScene();
await editor.value?.initRobots(); await editor.value?.initRobots();
await monitorScene(); await monitorScene();
await storageLocationService.value?.startMonitoring({ interval: 3 }); storageLocationService.value?.startMonitoring({ interval: 3 });
// //
await handleAutoSaveAndRestoreViewState(); await handleAutoSaveAndRestoreViewState();
}); });

View File

@ -643,16 +643,17 @@ export class EditorService extends Meta2d {
if (existingIcon) { if (existingIcon) {
this.setValue({ id: lockIconId, visible: true }, { render: true, history: false, doEvent: false }); this.setValue({ id: lockIconId, visible: true }, { render: true, history: false, doEvent: false });
} else { } else {
const { x = 0, y = 0, width = 0 } = this.getPenRect(pointPen); const { x = 0, y = 0 } = this.getPenRect(pointPen);
const iconPen: MapPen = { const iconPen: MapPen = {
id: lockIconId, id: lockIconId,
name: 'image', name: 'circle',
tags: ['lock-icon'], tags: ['lock-icon'],
x: x - width / 2 - 20, // 在点左侧显示 x: x - 14, // 在点右侧显示
y: y - 10, y: y + 16,
width: 16, width: 8,
height: 16, height: 8,
image: '/icons/lock.svg', background: '#ff4d4f', // 红色背景
color: '#ff4d4f',
locked: LockState.Disable, locked: LockState.Disable,
visible: true, visible: true,
}; };