Skip to content

fix: correctly overflow center/right+nowrap text#193

Merged
ccbrown merged 3 commits into
mainfrom
fix-alignment-overflow
Apr 18, 2026
Merged

fix: correctly overflow center/right+nowrap text#193
ccbrown merged 3 commits into
mainfrom
fix-alignment-overflow

Conversation

@ccbrown
Copy link
Copy Markdown
Owner

@ccbrown ccbrown commented Apr 18, 2026

What It Does

This fixes the issue raised in #188.

Previously, if center or right aligned non-wrapping text was placed in a view with a constrained width, we would encounter a panic:

element! {
    View(
        flex_direction: FlexDirection::Column,
        width: 9,
    ) {
        Text(
            content: "123123123123",
            align: TextAlign::Center,
            wrap: TextWrap::NoWrap
        )
    }
}
.print();

This PR corrects the issue, allowing the text to correctly spill over to the left and/or the right as needed, while keeping it aligned to the correct point.

Related Issues

@ccbrown ccbrown added the bug Something isn't working label Apr 18, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 18, 2026

Codecov Report

❌ Patch coverage is 98.26087% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.92%. Comparing base (ac23e6d) to head (7539f62).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/iocraft/src/components/mixed_text.rs 80.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #193      +/-   ##
==========================================
+ Coverage   87.71%   87.92%   +0.21%     
==========================================
  Files          35       35              
  Lines        5526     5617      +91     
  Branches     5526     5617      +91     
==========================================
+ Hits         4847     4939      +92     
+ Misses        570      569       -1     
  Partials      109      109              
Files with missing lines Coverage Δ
packages/iocraft/src/components/text.rs 99.63% <100.00%> (+0.69%) ⬆️
packages/iocraft/src/components/text_input.rs 68.82% <100.00%> (ø)
packages/iocraft/src/components/mixed_text.rs 92.30% <80.00%> (+0.38%) ⬆️

Impacted file tree graph

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ccbrown ccbrown merged commit 9e61bad into main Apr 18, 2026
5 checks passed
@ccbrown ccbrown deleted the fix-alignment-overflow branch April 18, 2026 20:48
This was referenced Apr 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant