Commit Graph

10 Commits (23b974fb39bee3f679f4283b941d6e57230415b6)

Author SHA1 Message Date
Peter Nelson f6ad8e1c9c Change: Rename some freetype things to fontcache.
The font cache supports more than just FreeType as a font provider, but still used freetype in some naming.

This now uses more suitable terms.
2 years ago
PeterN 0b460bf4a1
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.
3 years ago
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 5 years ago
Michael Lutz d2ed426077 Codechange: [Win32] Pass a native GDI font description around when we have one, instead of repeatedly guessing the font. 5 years ago
Henry Wilson c01a2e2a81 Codechange: Removed SmallVector completely 5 years ago
peter1138 b1fb3f4fb8 Codechange: More use of override keyword. 5 years ago
frosch dfa0e61f25 (svn r25816) -Add [FS#5748]: Toggle button for wrapping lines in the textfile GUI (LordAro) 11 years ago
rubidium 6356178a25 (svn r23936) -Feature [FS#5047]: readme/licence/changelog viewer for AI and game scripts (LordAro) 12 years ago
rubidium 58269b7ad2 (svn r23935) -Codechange: generalise GetTextfile 12 years ago
rubidium e8dbcf9043 (svn r23932) -Codechange: split the NewGRF text window into its own source files 12 years ago