-
Notifications
You must be signed in to change notification settings - Fork 171
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
[GuiAdvancedScrollText] Improve performance #1946
base: master
Are you sure you want to change the base?
[GuiAdvancedScrollText] Improve performance #1946
Conversation
Prepare fonts for entries only when adding an entry, rather than for every entry on every frame.
Re-prep fonts to reflow and recalculate entry height when the window width changes. This causes significant performance impacts when resizing the window with a large log.
Ran out of spare time on this, so I'm posting it up in case someone can improve on it. |
|
||
//Draw the visible entries | ||
float draw_offset = -scrollbar->getValue(); | ||
float draw_offset = -scrollbar->getValue() + text_size + 12.0f; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bad kludge to realign text now that the positioning lives in the Entry
rather than recalculated each onDraw.
#1947 was caught while doing this. An example of a potential fix involves checking the prefix text as well as the entry text, which requires adding a |
Re: #1939
This refactors GuiAdvancedScrollText to improve render performance.
Testing on a variety of systems with a 10,000-entry log, this maintains:
Known issues: