fix(agent-office): critical bug fixes from code review — wall pathfinding, drag/click, DPR, culling

- Pathfinder.setBlocked: remove blocked.clear() to preserve wall tiles set by setWalls()
- Pathfinder.findPath: fix dead-code goal exception — remove redundant isBlocked check, keep goal-tile exception in single guard
- OfficeRenderer: track mouseDownPos/_wasDragging; expose wasDragging() method for click-after-drag suppression
- OfficeRenderer._render: track _lastDpr to detect monitor DPR changes; use setTransform instead of scale to avoid accumulation
- TileMap.render: use clientWidth/clientHeight for viewport culling (CSS space, not buffer pixels)
- TaskTab: wrap JSON.parse in try/catch to prevent crash on malformed result_data

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-04-27 09:40:08 +09:00
parent 3e4f2e0934
commit 6cbdf95596
6 changed files with 37 additions and 11 deletions

View File

@@ -13,7 +13,7 @@ export class Pathfinder {
/** blocked 타일 세팅 (wall + furniture footprint) */
setBlocked(blockedList) {
this.blocked.clear();
// Do NOT clear — setWalls already added wall tiles
for (const [col, row] of blockedList) {
this.blocked.add(`${col},${row}`);
}
@@ -65,9 +65,9 @@ export class Pathfinder {
const nr = current.row + dr;
const nk = key(nc, nr);
if (visited.has(nk) || this.isBlocked(nc, nr)) continue;
if (visited.has(nk)) continue;
// 골 지점은 blocked여도 이동 가능 (에이전트가 자기 자리에 앉으려면)
if (nk !== goalKey && this.blocked.has(nk)) continue;
if (nk !== goalKey && this.isBlocked(nc, nr)) continue;
visited.add(nk);
parent.set(nk, key(current.col, current.row));