[PR #5360] [MERGED] Bias a books line seek by vanilla*s two pixels #6238

Closed
opened 2026-11-03 06:16:13 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5360
Author: @MSedgeMC
Created: 10/31/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @ludovic111

Base: main ← Head: fix/book-line-seek-bias


📝 Commits (1)

  • 3b7fd2e Bias a books line seek by vanilla*s two pixels

📊 Changes

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

View changed files

📝 crates/horizon-client/src/game/books.rs (+2 -1)
📝 tools/port_map/client2-011.tsv (+1 -1)

📄 Description

MultilineTextField.seekCursorLine measures the caret with ont.width(prefix) + LINE_SEEK_PIXEL_BIAS (2) before choosing where to land; the caret it draws is not biased. Horizon used the unbiased x for both, so pressing ArrowDown with the caret at a line start can land before a narrow first glyph instead of after it.

One argument at one call site, with a comment naming the constant, and the ledger row's stale note cleared.

Not proven: no test is realistic — the seek needs a live font atlas, and nothing in this repo drives a GUI text field. The check is a page whose second line starts with a narrow glyph, caret at the line above, ArrowDown.

One caveat for whoever reviews: Horizon's Font::fit accumulates f32 advances where vanilla's seek uses integer ont.width plus 2, so a sub-pixel advance could differ by one character at a boundary. That convention is pre-existing throughout the book code and was not changed here.


🔄 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/5360 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 10/31/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/book-line-seek-bias` --- ### 📝 Commits (1) - [`3b7fd2e`](https://github.com/horizon-rust/horizon/commit/3b7fd2ea1523e597fb61e0260cc36d5ab7420a37) Bias a books line seek by vanilla*s two pixels ### 📊 Changes **2 files changed** (+3 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/books.rs` (+2 -1) 📝 `tools/port_map/client2-011.tsv` (+1 -1) </details> ### 📄 Description MultilineTextField.seekCursorLine measures the caret with ont.width(prefix) + LINE_SEEK_PIXEL_BIAS (2) before choosing where to land; the caret it **draws** is not biased. Horizon used the unbiased x for both, so pressing ArrowDown with the caret at a line start can land before a narrow first glyph instead of after it. One argument at one call site, with a comment naming the constant, and the ledger row's stale note cleared. **Not proven:** no test is realistic — the seek needs a live font atlas, and nothing in this repo drives a GUI text field. The check is a page whose second line starts with a narrow glyph, caret at the line above, ArrowDown. One caveat for whoever reviews: Horizon's Font::fit accumulates f32 advances where vanilla's seek uses integer ont.width plus 2, so a sub-pixel advance could differ by one character at a boundary. That convention is pre-existing throughout the book code and was not changed here. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:16:13 +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#6238
No description provided.