PosCounter.cs 878 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. using System.Drawing;
  2. namespace FastReport.FastQueryBuilder
  3. {
  4. internal class PosCounter
  5. {
  6. private Point next;
  7. private int initX;
  8. private int initY;
  9. public int stepX = 10;
  10. public int stepY = 10;
  11. public int maxX = 100;
  12. public int maxY = 100;
  13. public Point Next
  14. {
  15. get
  16. {
  17. var current = next;
  18. next.X += stepX;
  19. if (next.X > maxX)
  20. {
  21. next.X = initX;
  22. next.Y += stepY;
  23. }
  24. if (next.Y > maxY)
  25. next.Y = initY;
  26. return current;
  27. }
  28. }
  29. public PosCounter(int X, int Y)
  30. {
  31. next.X = X;
  32. next.Y = Y;
  33. initX = X;
  34. initY = Y;
  35. }
  36. }
  37. }