Padding.cs 863 B

123456789101112131415161718192021222324252627282930313233
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Runtime.CompilerServices;
  5. using System.Runtime.InteropServices;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace Veldrid.Common
  9. {
  10. [StructLayout(LayoutKind.Sequential,Pack =1)]
  11. public struct Padding
  12. {
  13. public float Left;
  14. public float Top;
  15. public float Right;
  16. public float Bottom;
  17. public Padding(float left = 0, float top = 0, float right = 0, float bottom = 0)
  18. {
  19. Left = left;
  20. Top = top;
  21. Right = right;
  22. Bottom = bottom;
  23. }
  24. public Padding(float all = 0) : this(all, all, all, all)
  25. {
  26. }
  27. public static Padding Zero { get; } = new Padding();
  28. public static UInt32 Size { get; } = (uint)Unsafe.SizeOf<Padding>();
  29. }
  30. }