mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-02-03 01:51:13 +00:00
Added ChangeSize function to TexturePacker.
This commit is contained in:
parent
a19c45e895
commit
e5278cf454
|
@ -76,7 +76,10 @@ namespace OpenTK
|
||||||
{
|
{
|
||||||
Node node;
|
Node node;
|
||||||
bool found = items.TryGetValue(item, out node);
|
bool found = items.TryGetValue(item, out node);
|
||||||
|
if (found)
|
||||||
rect = node.Rect;
|
rect = node.Rect;
|
||||||
|
else
|
||||||
|
rect = new Rectangle();
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -95,6 +98,23 @@ namespace OpenTK
|
||||||
|
|
||||||
#endregion
|
#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
|
#region Node
|
||||||
|
|
||||||
class Node
|
class Node
|
||||||
|
|
Loading…
Reference in a new issue