mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-10 17:46:53 -10:00
The original issue was reported by Novachen in #1754 where a significant slowdown was encountered in the controls menu (Ship and Misc tabs). I traced the cause of the slowdown to repeated uploads of the NanoVG font atlas texture even though no changes were necessary. The root cause of the issue was that NanoVG did not handle invalid UTF-8 sequences at the end of a string properly. The UTF-8 decoder returned a success code even though no code point was decoded which lead the rest of the code to believe that the font atlas needed to be recreated. This fixes #1754 by properly handling that case. This also fixed an assertion failure if NanoVG was asked to render 2D elements without any vertices.