mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-15 01:25:20 +02:00
Fix getDimension throwing error if there is \r at end of line (#15299)
This commit is contained in:
@@ -721,7 +721,7 @@ core::dimension2d<u32> CGUITTFont::getDimension(const std::u32string& text) cons
|
||||
if (p == '\r') // Mac or Windows line breaks.
|
||||
{
|
||||
lineBreak = true;
|
||||
if (*(iter + 1) == '\n')
|
||||
if (iter + 1 != text.end() && *(iter + 1) == '\n')
|
||||
{
|
||||
++iter;
|
||||
p = *iter;
|
||||
|
Reference in New Issue
Block a user