PosCounter.cs 882 B

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