[PR #4141] [MERGED] Hit-test the one-pixel border around inventory slots #5439

Closed
opened 2026-11-03 05:12:36 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4141
Author: @DUzzL
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/30/2026
Merged by: @rdbtCVS

Base: main ← Head: fix/issue-4134-slot-gap-hover


📝 Commits (2)

  • a97afdc Hover the nearest slot when the pointer is in the gap between slots
  • 8ec6e3d Update port ledger note for slot_at hover margin

📊 Changes

2 files changed (+4 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game.rs (+3 -1)
📝 tools/port_map/gui-inventory-1.tsv (+1 -1)

📄 Description

🤖 Opened by DUzzL's AI agent, not by DUzzL personally.

Fixes #4134

Cause: slot_at in game.rs hit-tested only the bare 16x16 slot box. The 2 px gaps between slots (the "lines" in the report) selected nothing. Vanilla's isHovering grows each slot by one pixel per side.

Change: slot_at accepts x/y from slot - 1 up to slot + 17. Slots are 18 px apart, so the grown boxes touch without overlapping. Where two boxes would overlap, find returns the first slot in slots() order, which is deterministic. A pointer over a slot behaves as before. The port ledger note for isHovering in tools/port_map/gui-inventory-1.tsv is updated to match.

Tested: cargo fmt --check, cargo clippy -p horizon-client --all-targets -- -D warnings, and cargo test -p horizon-client --bins pass (196 and 18). No new test was added.

Not tested: no in-game run, and the reporter's video was not checked, so the "lines" are read from the issue text. Creative-screen slot spacing was not confirmed to stay at 18 px. No vanilla source was checked directly (none in the repo). tools/pr_ready.py not run.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/4141 **Author:** [@DUzzL](https://github.com/DUzzL) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/30/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `fix/issue-4134-slot-gap-hover` --- ### 📝 Commits (2) - [`a97afdc`](https://github.com/horizon-rust/horizon/commit/a97afdc93fb152411e97c2fe25d0f814966b44ea) Hover the nearest slot when the pointer is in the gap between slots - [`8ec6e3d`](https://github.com/horizon-rust/horizon/commit/8ec6e3d9f41818a773242ae6586474392fd652c2) Update port ledger note for slot_at hover margin ### 📊 Changes **2 files changed** (+4 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game.rs` (+3 -1) 📝 `tools/port_map/gui-inventory-1.tsv` (+1 -1) </details> ### 📄 Description > 🤖 Opened by DUzzL's AI agent, not by DUzzL personally. Fixes #4134 **Cause:** `slot_at` in `game.rs` hit-tested only the bare 16x16 slot box. The 2 px gaps between slots (the "lines" in the report) selected nothing. Vanilla's `isHovering` grows each slot by one pixel per side. **Change:** `slot_at` accepts x/y from `slot - 1` up to `slot + 17`. Slots are 18 px apart, so the grown boxes touch without overlapping. Where two boxes would overlap, `find` returns the first slot in `slots()` order, which is deterministic. A pointer over a slot behaves as before. The port ledger note for `isHovering` in `tools/port_map/gui-inventory-1.tsv` is updated to match. **Tested:** `cargo fmt --check`, `cargo clippy -p horizon-client --all-targets -- -D warnings`, and `cargo test -p horizon-client --bins` pass (196 and 18). No new test was added. **Not tested:** no in-game run, and the reporter's video was not checked, so the "lines" are read from the issue text. Creative-screen slot spacing was not confirmed to stay at 18 px. No vanilla source was checked directly (none in the repo). `tools/pr_ready.py` not run. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:12:36 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5439
No description provided.