Files
sbox-public/engine/Sandbox.Test/UI/Panel/BorderPadding.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

29 lines
617 B
C#

using Sandbox.UI;
namespace TestUI.Panels;
[TestClass]
public partial class BorderPadding
{
[TestMethod]
public void BorderDoesntChangeSize()
{
var root = new RootPanel();
root.PanelBounds = new Rect( 0, 0, 1000, 1000 );
var panela = root.Add.Panel();
panela.Style.Set( "width: 100px; height: 100px;" );
root.Layout();
Assert.AreEqual( 100, panela.Box.Right );
Assert.AreEqual( 100, panela.Box.Bottom );
panela.Style.Set( "width: 100px; height: 100px; border: 10px solid red;" );
root.Layout();
Assert.AreEqual( 100, panela.Box.Right );
Assert.AreEqual( 100, panela.Box.Bottom );
}
}