-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Beginning with 11.2.5 Buttons and TextBlocks does not show whitespaces #18372
Comments
Same here, very annoying. |
In 11.2.4, the problem also appears when using browser [wasm] app. |
It's likely that the PR #18310 had some unintended effect here. cc @xoofx @Gillibald |
Y I think I will revert that PR and introduce a different fix. WidthIncludingTrailingWhitespace is also broken in 11.2.4. It does not produce the correct results. With Courier New
|
I would prefer that we start from the current code that is more readable and fixed another annoying issue and fix it from there. As the repro case above should be easy to add as a unit test, I can have a look right now if that's ok? |
Feel free to have a look Here is my fix:
This is the previous implementation with a fix for the WidthIncludingTrailingWhitespace issue. Compare it to your version, and you will realise that all overhang values have been calculated incorrectly. Extend, OverhandLeading, OverhangTrailing and OverhangAfter represent the black pixels drawn outside the logical bounds. Your implementation just builds the overall maximum. |
Created a fix via #18438
I don't think that the previous code was correct either regarding these. We should reflect the OverhandLeading/Trailing/After given by the actual line metrics and not recompute something that has no link to the original line metrics. The problem was with |
Yes, the metrics were never correct. Each line reports its metrics relative to the line's origin. Each line can have a different origin. So you can't just take the maximum OverhangLeading etc. You need to calculate this value in respect to the ink and logical bounding box. |
Describe the bug
Beginning with 11.2.5 Buttons and TextBlocks does not show whitespaces. e.g. Strings like ' ' or 'Name: ' are not shown correctly.
This has a significant (negative) impact on the UI and the layout of my apps.
To Reproduce
Create a simple button with ' ' or 'Name: ' as content.
Expected behavior
Display whitespaces on Buttons and TextBlocks as before of 11.2.5. Especially leading or trailing whitespaces.
Avalonia version
11.2.5
OS
Windows
Additional context
No response
The text was updated successfully, but these errors were encountered: