dot.c 931 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include "globals.h"
  2. #include <grass/display.h>
  3. int dot(int x, int y)
  4. {
  5. double vx[5], vy[5];
  6. vx[0] = x;
  7. vy[0] = y - dotsize;
  8. vx[1] = x - dotsize;
  9. vy[1] = y;
  10. vx[2] = x;
  11. vy[2] = y + dotsize;
  12. vx[3] = x + dotsize;
  13. vy[3] = y;
  14. vx[4] = x;
  15. vy[4] = y - dotsize;
  16. R_polygon_abs(vx, vy, 5);
  17. /*
  18. int i;
  19. for (i = 0; i < dotsize; i++)
  20. {
  21. R_move_abs (x-i, y+i-dotsize);
  22. R_cont_rel (i+i,0);
  23. R_move_abs (x-i, y+dotsize-i);
  24. R_cont_rel (i+i,0);
  25. }
  26. R_move_abs (x-dotsize, y);
  27. R_cont_rel (dotsize+dotsize, 0);
  28. */
  29. return 0;
  30. }
  31. int save_under_dot(int x, int y)
  32. {
  33. R_panel_save(tempfile1, y - dotsize, y + dotsize, x - dotsize,
  34. x + dotsize);
  35. return 0;
  36. }
  37. int restore_under_dot(void)
  38. {
  39. R_panel_restore(tempfile1);
  40. return 0;
  41. }
  42. int release_under_dot(void)
  43. {
  44. R_panel_delete(tempfile1);
  45. return 0;
  46. }