-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
Help wanted: test a subtle text baseline offset / layout fix #2833
Comments
Thank you very much Michelle for testing and your detailed report, this is exactly what I was hoping for and I realized some of my mistakes in there. I have pushed a second commit: e484312 which I believe should fix those issues. Details: I wanted to do the ItemLayout thing now-ish but realized it was too much work short-term and wanted to focus back on Tables asap, however if my current change back-fire somehow I may have to go and do the full thing. Note that the Part of me wants to remove the text baseline offset system (the common issue is people doing |
Hi, Omar. I tested new branch in my glChAoS.P application, and now all works fine:
Thanks for explanation: I had the doubt that it could be one or the other.
But isn't this already a And (maybe/instead) use a Window flag, which makes this for the whole window, without upsetting the current mechanism? |
I pushed a temporary |
Good to hear, thanks!
The current system is quite error-prone both in the library code side and user's side, who rarely call |
…ating to text baseline alignment. The issue would generally manifest when laying out multiple items on a same line, with varying heights and text baseline offsets. (#2833) Some specific examples, e.g. a button with regular frame padding followed by another item with a multi-line label and no frame padding, such as: multi-line text, small button, tree node item, etc. The second item was correctly offset to match text baseline, and would interact/display correctly,but it wouldn't push the contents area boundary low enough. Note: previously the second parameter to ItemSize() was 0.0f was default, now -1.0f to signify "no text baseline offset request". If you have code using ItemSize() with an hardcoded zero you may need to change it. (+1 squashed commits)
This is now merged in master (I also got a second feedback from @rokups about it). |
I pushed a test branch:
https://github.com/ocornut/imgui/tree/features/baseline_multiline_label_fixes
With one commit:
0ad1d97
And would love it if some people could test their advanced imgui app with this commit and test me if anything looks off. Specifically, the fix relates the vertical alignment of multiple items of varying size on a same line, and more specically would be more likely to happen when using multi-line label or when altering FramePadding.
If you have time to test this a little, just write a note below (bonus: with a screenshot of what you have tested ;). Thanks!
To quick test you can either update to this branch, either merge the branch in yours, either cherry-pick this commit
git fetch https://github.com/ocornut/imgui features/baseline_multiline_label_fixes
(or
git fetch origin features/baseline_multiline_label_fixes
)Followed by
git cherry-pick 0ad1d97fb55fb8472daf4ca5dcfaed874f56758d
My automated test case, before and after:
AlignTextToFramePadding()
, it was more easy to get into a situation where you would submit e.g. a multi-line wrapped text and it would size the table line correctly. This is why I got into fixing this in the first place!Thanks!
(PS: text baseline offset is an obtuse thing that I don't expect many people understand or have notice in dear imgui !)
The text was updated successfully, but these errors were encountered: