Added ChangeSize function to TexturePacker.

This commit is contained in:
the_fiddler 2007-10-20 10:36:27 +00:00
parent a19c45e895
commit e5278cf454

View file

@ -76,7 +76,10 @@ namespace OpenTK
{
Node node;
bool found = items.TryGetValue(item, out node);
rect = node.Rect;
if (found)
rect = node.Rect;
else
rect = new Rectangle();
return found;
}
@ -95,6 +98,23 @@ namespace OpenTK
#endregion
#region public void ChangeSize(int new_width, int new_height)
/// <summary>
/// Changes the dimensions of the TexturePacker surface.
/// </summary>
/// <param name="new_width">The new width of the TexturePacker surface.</param>
/// <param name="new_height">The new height of the TexturePacker surface.</param>
/// <remarks>Changing the size of the TexturePacker surface will implicitly call TexturePacker.Clear().</remarks>
/// <seealso cref="Clear"/>
public void ChangeSize(int new_width, int new_height)
{
Clear();
root.Rect = new Rectangle(0, 0, new_width, new_height);
}
#endregion
#region Node
class Node