diff options
author | PeterN <peter1138@openttd.org> | 2021-04-29 18:58:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-29 18:58:26 +0100 |
commit | 0b460bf4a17e12ba479e0822b8f9b7de29ac5816 (patch) | |
tree | c331e1f4cb2aebb83c7c44a96f7de509d0c3e22f /src/script/api/script_goal.hpp | |
parent | 72a05921b06b02b04af6e86d981f55de4960ca61 (diff) | |
download | openttd-0b460bf4a17e12ba479e0822b8f9b7de29ac5816.tar.xz |
Fix: 'Cache' top and bottom lines of textfile viewer to avoid overdraw. (#9131)
* Fix: 'Cache' top and bottom lines of textfile viewer to avoid overdraw.
The text file viewer calculated the number of lines required to set the scrollbar, but did not retain this information, so this was recalculated on every draw operation. This includes overdrawing text outside the bounds of the current scroll position.
With this change the top and bottom lines for each line of text are remembered, and reflowing is avoided where possible. Text outside the current scroll bounds is not drawn.
Additionally the scroll interval is now based on text lines instead of pixel lines, which increases the text capacity depending on the font size.
* Fix: Limit text viewer to showing 64k lines.
Text files with more than 64k wrapped lines would exceed the scrollbar capacity and cause an assert. This is harder to reach now that the scrollbar counts lines instead of pixels.
Diffstat (limited to 'src/script/api/script_goal.hpp')
0 files changed, 0 insertions, 0 deletions