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:
the_fiddler 2009-05-30 17:58:41 +00:00
parent 7244b80332
commit 88f1ce081f

View file

@ -89,7 +89,8 @@ namespace OpenTK.Graphics.Text
int current = 0;
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++;
continue;