home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume19 / xfig / part01 / u_pan.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-27  |  1.5 KB  |  74 lines

  1. /*
  2.  * FIG : Facility for Interactive Generation of figures
  3.  * Copyright (c) 1991 by Henning Spruth
  4.  *
  5.  * "Permission to use, copy, modify, distribute, and sell this software and its
  6.  * documentation for any purpose is hereby granted without fee, provided that
  7.  * the above copyright notice appear in all copies and that both the copyright
  8.  * notice and this permission notice appear in supporting documentation. 
  9.  * No representations are made about the suitability of this software for 
  10.  * any purpose.  It is provided "as is" without express or implied warranty."
  11.  */
  12.  
  13. #include "fig.h"
  14. #include "resources.h"
  15. #include "mode.h"
  16. #include "w_zoom.h"
  17.  
  18. pan_left()
  19. {
  20.     zoomxoff += posn_rnd[P_GRID2];
  21.     reset_topruler();
  22.     redisplay_topruler();
  23.     setup_grid(cur_gridmode);
  24. }
  25.  
  26. pan_right()
  27. {
  28.     if (zoomxoff == 0)
  29.     return;
  30.     zoomxoff -= posn_rnd[P_GRID2];
  31.     if (zoomxoff < 0)
  32.     zoomxoff = 0;
  33.     reset_topruler();
  34.     redisplay_topruler();
  35.     setup_grid(cur_gridmode);
  36. }
  37.  
  38. pan_up()
  39. {
  40.     zoomyoff += posn_rnd[P_GRID2];
  41.     reset_sideruler();
  42.     redisplay_sideruler();
  43.     setup_grid(cur_gridmode);
  44. }
  45.  
  46. pan_down()
  47. {
  48.     if (zoomyoff == 0)
  49.     return;
  50.     zoomyoff -= posn_rnd[P_GRID2];
  51.     if (zoomyoff < 0)
  52.     zoomyoff = 0;
  53.     reset_sideruler();
  54.     redisplay_sideruler();
  55.     setup_grid(cur_gridmode);
  56. }
  57.  
  58. pan_origin()
  59. {
  60.     if (zoomxoff == 0 && zoomyoff == 0)
  61.     return;
  62.     if (zoomyoff != 0) {
  63.     zoomyoff = 0;
  64.     setup_sideruler();
  65.     redisplay_sideruler();
  66.     }
  67.     if (zoomxoff != 0) {
  68.     zoomxoff = 0;
  69.     reset_topruler();
  70.     redisplay_topruler();
  71.     }
  72.     setup_grid(cur_gridmode);
  73. }
  74.