Bounds.cs 550 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #if MONOGAME || FNA
  2. using Microsoft.Xna.Framework;
  3. #elif STRIDE
  4. using Stride.Core.Mathematics;
  5. #else
  6. using System.Numerics;
  7. #endif
  8. namespace FontStashSharp
  9. {
  10. public struct Bounds
  11. {
  12. public static readonly Bounds Empty = new Bounds
  13. {
  14. X = 0,
  15. Y = 0,
  16. X2 = 0,
  17. Y2 = 0,
  18. };
  19. public float X, Y, X2, Y2;
  20. public Bounds(float x, float y, float x2, float y2)
  21. {
  22. X = x;
  23. Y = y;
  24. X2 = x2;
  25. Y2 = y2;
  26. }
  27. public void ApplyScale(Vector2 scale)
  28. {
  29. X *= scale.X;
  30. Y *= scale.Y;
  31. X2 *= scale.X;
  32. Y2 *= scale.Y;
  33. }
  34. }
  35. }