Position.cs 507 B

1234567891011121314151617181920212223
  1. namespace QuestPDF.Infrastructure
  2. {
  3. internal readonly struct Position
  4. {
  5. public readonly float X;
  6. public readonly float Y;
  7. public static Position Zero => new Position(0, 0);
  8. public Position(float x, float y)
  9. {
  10. X = x;
  11. Y = y;
  12. }
  13. public Position Reverse()
  14. {
  15. return new Position(-X, -Y);
  16. }
  17. public override string ToString() => $"(Left: {X:N3}, Top: {Y:N3})";
  18. }
  19. }