Skip to content
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

Add an argment to disable pixel perfect text alignment to eliminate … #3437

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

EricStancliff
Copy link

…jitter when placing labels onto objects moving quickly across the screen.

I'm using the GetBackgroundDrawList()->addText() paired with rounded rects for backgrounds to draw screen space labels for jets flying around in an airpsace. The labels would appear to "bounce" around when the jet flies. I identified this was due to the pixel perfect positioning of the text object. Confirmed that adding this to my project solved the issue and the text labels still looked great.

Thanks!

…jitter when placing labels onto objects moving quickly across the screen.
@ocornut
Copy link
Owner

ocornut commented Aug 28, 2020

Hello and thanks for the PR.
See #2291

API wise I don’t believe adding new bool arguments to all those functions is going to be the right thing to do. We either need to statefully associate that flag to the font or the drawlist, or wait until we refactor the text functions with flags and more elaborate inputs. Either way it may have to wait a little bit.

@EricStancliff
Copy link
Author

Awesome! Sorry I missed that number. Glad to hear this may be a baselined feature one day - I'll track this to see when I can sync back up!

@ocornut ocornut changed the title Add an arugment to disable pixel perfect text alignment to eliminate … Add an argment to disable pixel perfect text alignment to eliminate … Aug 29, 2020
ocornut added a commit that referenced this pull request Feb 1, 2021
…ceil. (#3776)

his is in order for text wrapping to have enough space when provided width precisely calculated with CalcTextSize().x. Amend 7b0bf23.
Note that the rounding of either positions and widths are technically undesirable (e.g. #3437, #791) but variety of code is currently on it so we are first fixing current behavior before we'll eventually change it.
@ocornut ocornut force-pushed the master branch 2 times, most recently from 0c1e5bd to bb6a60b Compare August 27, 2021 19:10
@ocornut ocornut force-pushed the master branch 2 times, most recently from 8b83e0a to d735066 Compare December 13, 2021 11:31
@ocornut ocornut force-pushed the master branch 2 times, most recently from b3b85d8 to 0755767 Compare January 17, 2022 14:21
@ocornut ocornut force-pushed the master branch 3 times, most recently from c817acb to 8d39063 Compare February 15, 2022 16:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants