Skip to content

Use ink_rect's width and set alignment before getting dimensions#375

Merged
trigg merged 1 commit intotrigg:masterfrom
mohad12211:fix-right-alignment
Mar 24, 2026
Merged

Use ink_rect's width and set alignment before getting dimensions#375
trigg merged 1 commit intotrigg:masterfrom
mohad12211:fix-right-alignment

Conversation

@mohad12211
Copy link
Copy Markdown
Contributor

  1. Set the layout alignment before getting the box dimensions (ink_rect, logical_rect) = layout.get_pixel_extents()

  2. use ink_rect.width instead of logical_rect.width

    • If you use the logical rect, for some special RTL cases, the text would be over the avatar or very close to it.
    • I noticed that the commit that made the Right Align Text No Longer shown in 0.7.9 #368 regression (369ba96) was trying to solve some RTL issue, so I also tried to tackle this as well, there might be more RTL issues, but it should be better now.

@trigg
Copy link
Copy Markdown
Owner

trigg commented Mar 24, 2026

Apologies for delay. Thank you for the contribution!

@trigg trigg merged commit ae75d96 into trigg:master Mar 24, 2026
@mohad12211 mohad12211 deleted the fix-right-alignment branch March 24, 2026 18:12
@mohad12211
Copy link
Copy Markdown
Contributor Author

Thank you for maintaining this amazing project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Right Align Text No Longer shown in 0.7.9

2 participants