mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-13 14:25:31 +00:00
Add 2 pixels of space between packed glyphs, to avoid rendering artifacts.
This commit is contained in:
parent
72e1216a31
commit
5e449dabd4
|
@ -41,13 +41,17 @@ namespace OpenTK.Graphics.Text
|
||||||
throw new InvalidOperationException("The item is too large for this TexturePacker");
|
throw new InvalidOperationException("The item is too large for this TexturePacker");
|
||||||
|
|
||||||
Node node;
|
Node node;
|
||||||
|
// Increase size so that the glyphs do not touch each other (to avoid rendering artifacts).
|
||||||
|
boundingBox.Width += 2;
|
||||||
|
boundingBox.Height += 2;
|
||||||
node = root.Insert(boundingBox);
|
node = root.Insert(boundingBox);
|
||||||
|
|
||||||
// Tree is full and insertion failed:
|
// Tree is full and insertion failed:
|
||||||
if (node == null)
|
if (node == null)
|
||||||
throw new TexturePackerFullException();
|
throw new TexturePackerFullException();
|
||||||
|
|
||||||
return node.Rectangle;
|
return new Rectangle(node.Rectangle.X, node.Rectangle.Y, node.Rectangle.Width - 2, node.Rectangle.Height - 2);
|
||||||
|
//return node.Rectangle;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
Loading…
Reference in a new issue