SkillBarHUD.setSlots([]) leaves stale drag AABB after clearing slots #1082

Closed
opened 2026-08-13 13:53:36 +00:00 by spikerj · 1 comment
Owner

Where: projects/spikersoft/src/app/_components/_games/dungeon-crawler/hud/skill-bar-hud.ts — setSlots([]) → rebuildSlots().

What: After slots have been built, emptying the loadout calls clearGroup() then rebuildSlots(), which early-returns on count === 0 without resetting _bounds. The previous AABB (width = n*48+(n-1)*4, y = 80) is left in place. HUDPanel.handleDragMouseDown still hits that rectangle, so the player can drag an invisible skill bar.

Repro (unit): hud.setSlots([spell, spell]); hud.setSlots([]); → _bounds.width stays 100 and group.children.length is 0.

Expected: empty loadout should zero _bounds (and skip drag) the same way the constructor starts.

Found by Wave 8 a2 coverage tests.

**Where:** `projects/spikersoft/src/app/_components/_games/dungeon-crawler/hud/skill-bar-hud.ts` — `setSlots([])` → `rebuildSlots()`. **What:** After slots have been built, emptying the loadout calls `clearGroup()` then `rebuildSlots()`, which early-returns on `count === 0` without resetting `_bounds`. The previous AABB (`width = n*48+(n-1)*4`, `y = 80`) is left in place. `HUDPanel.handleDragMouseDown` still hits that rectangle, so the player can drag an invisible skill bar. **Repro (unit):** `hud.setSlots([spell, spell]); hud.setSlots([]);` → `_bounds.width` stays `100` and `group.children.length` is `0`. **Expected:** empty loadout should zero `_bounds` (and skip drag) the same way the constructor starts. Found by Wave 8 a2 coverage tests.
Author
Owner

Fixed in spikersoft-angular PR #823 (a0f0ccd9). Closing.

Fixed in `spikersoft-angular` [PR #823](https://git.spikersoft.com/spikerj/spikersoft-angular/pulls/823) (`a0f0ccd9`). Closing.
Sign in to join this conversation.