[PR #6185] [CLOSED] Buttons: a label wider than the button keeps its left edge #6705

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6185
Author: @Domanffe
Created: 11/1/2026
Status: ❌ Closed

Base: main ← Head: fix/wide-button-label-clamp


📝 Commits (1)

  • 0535b44 Buttons: a label wider than the button keeps its left edge

📊 Changes

1 file changed (+35 additions, -2 deletions)

View changed files

📝 crates/horizon-client-render/src/screen_draw.rs (+35 -2)

📄 Description

🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself.

Fixes #6129

screen_draw::button centred a label with
((left + right) / 2).clamp(left + lw / 2, right - lw / 2). A label wider than
the button's inner box makes the lower bound greater than the upper one, and
clamp panics there. pack.openFolder in the eight languages the report lists
is the only label long enough today: 150 to 171 px inside a 150 px button.

Vanilla never clamps a label that is too wide: ActiveTextCollector.defaultScrollingHelper
draws it from the left edge, scissored and scrolling with the clock, and only
centres a label that fits. Horizon has no clock here, so this keeps the left
edge for the wider case and leaves the clamp as it was for every label that
fits.

a_label_wider_than_its_button_keeps_its_left_edge pins the Afrikaans width
from the report (154 px), the widest of the eight (isv, about 171 px), a label
that fills the box exactly and one that fits.

What I did not observe: the Resource Packs screen drawn in one of those eight
languages. The panic was a pure arithmetic case that the test now covers; the
screen itself was not opened here.

The pr_ready block follows as a comment.


🔄 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/6185 **Author:** [@Domanffe](https://github.com/Domanffe) **Created:** 11/1/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/wide-button-label-clamp` --- ### 📝 Commits (1) - [`0535b44`](https://github.com/horizon-rust/horizon/commit/0535b44361a233777dbd8ef9953551ea554ddd6c) Buttons: a label wider than the button keeps its left edge ### 📊 Changes **1 file changed** (+35 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/screen_draw.rs` (+35 -2) </details> ### 📄 Description > 🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself. Fixes #6129 `screen_draw::button` centred a label with `((left + right) / 2).clamp(left + lw / 2, right - lw / 2)`. A label wider than the button's inner box makes the lower bound greater than the upper one, and `clamp` panics there. `pack.openFolder` in the eight languages the report lists is the only label long enough today: 150 to 171 px inside a 150 px button. Vanilla never clamps a label that is too wide: `ActiveTextCollector.defaultScrollingHelper` draws it from the left edge, scissored and scrolling with the clock, and only centres a label that fits. Horizon has no clock here, so this keeps the left edge for the wider case and leaves the clamp as it was for every label that fits. `a_label_wider_than_its_button_keeps_its_left_edge` pins the Afrikaans width from the report (154 px), the widest of the eight (isv, about 171 px), a label that fills the box exactly and one that fits. What I did not observe: the Resource Packs screen drawn in one of those eight languages. The panic was a pure arithmetic case that the test now covers; the screen itself was not opened here. The `pr_ready` block follows as a comment. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:25:10 +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#6705
No description provided.