mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-06-04 04:28:26 +00:00
Do not render text that doesn't fit inside the clip rectangle. Fixes bug [#847]: "TextPrinter layout when width, height are zero." (http://www.opentk.com/node/847).
This commit is contained in:
parent
f39628bbb2
commit
0ef25e5c89
|
@ -89,7 +89,8 @@ namespace OpenTK.Graphics.Text
|
||||||
int current = 0;
|
int current = 0;
|
||||||
foreach (Glyph glyph in block)
|
foreach (Glyph glyph in block)
|
||||||
{
|
{
|
||||||
if (glyph.IsWhiteSpace)
|
// Do not render whitespace characters or characters outside the clip rectangle.
|
||||||
|
if (glyph.IsWhiteSpace || extents[current].Width == 0 || extents[current].Height == 0)
|
||||||
{
|
{
|
||||||
current++;
|
current++;
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Reference in a new issue