mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Move line width addition in next_wrap to be after switch block
There is no overlap in side effects between this line and the switch statement after it, but it did result in adding the width of a final null terminator or newline to the width of the current line, which is a waste because those widths both 1) require trying to find non-existent characters in the font and 2) will not be used. I found this out because I added a debug print in find_glyphinfo(), and something was requesting lots of codepoint 0 from the font.
This commit is contained in:
parent
2934462410
commit
28e9df7f47
1 changed files with 2 additions and 2 deletions
|
@ -798,8 +798,6 @@ static bool next_wrap(
|
|||
goto next;
|
||||
}
|
||||
|
||||
linewidth += get_advance(f, str[idx]);
|
||||
|
||||
switch (str[idx])
|
||||
{
|
||||
case ' ':
|
||||
|
@ -817,6 +815,8 @@ static bool next_wrap(
|
|||
return true;
|
||||
}
|
||||
|
||||
linewidth += get_advance(f, str[idx]);
|
||||
|
||||
if (linewidth > maxwidth)
|
||||
{
|
||||
if (lenfromlastspace != 0)
|
||||
|
|
Loading…
Reference in a new issue