mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-12 23:24:41 +00:00
Prevents GFXDrawUtil::drawTextN() from drawing one character more than requested if in_string has more than n characters.
This commit is contained in:
parent
a6710285db
commit
77da6900a8
1 changed files with 2 additions and 3 deletions
|
|
@ -148,9 +148,8 @@ U32 GFXDrawUtil::drawTextN( GFont *font, const Point2I &ptDraw, const UTF8 *in_s
|
||||||
return ptDraw.x;
|
return ptDraw.x;
|
||||||
|
|
||||||
// Convert to UTF16 temporarily.
|
// Convert to UTF16 temporarily.
|
||||||
n++; // space for null terminator
|
FrameTemp<UTF16> ubuf( n + 1 ); // (n+1) to add space for null terminator
|
||||||
FrameTemp<UTF16> ubuf( n );
|
convertUTF8toUTF16N(in_string, ubuf, n + 1);
|
||||||
convertUTF8toUTF16N(in_string, ubuf, n);
|
|
||||||
|
|
||||||
return drawTextN( font, ptDraw, ubuf, n, colorTable, maxColorIndex, rot );
|
return drawTextN( font, ptDraw, ubuf, n, colorTable, maxColorIndex, rot );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue