home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / GRAPH / GCLIP.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  483 b   |  26 lines

  1. /* gclip.c (emx+gcc) -- Copyright (c) 1987-1993 by Eberhard Mattes */
  2.  
  3. #include <stdlib.h>
  4. #include <graph.h>
  5. #include "graph2.h"
  6.  
  7. void g_clip (int x0, int y0, int x1, int y1)
  8. {
  9.   if (x0 < 0)
  10.     _g_clipx0 = 0;
  11.   else
  12.     _g_clipx0 = x0;
  13.   if (y0 < 0)
  14.     _g_clipy0 = 0;
  15.   else
  16.     _g_clipy0 = y0;
  17.   if (x1 >= _g_xsize)
  18.     _g_clipx1 = _g_xsize - 1;
  19.   else
  20.     _g_clipx1 = x1;
  21.   if (y1 >= _g_ysize)
  22.     _g_clipy1 = _g_ysize - 1;
  23.   else
  24.     _g_clipy1 = y1;
  25. }
  26.