home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C / Utilities / DVIM72-Mac 1.9.6 / source / FILLRECT.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-09-14  |  1.2 KB  |  47 lines  |  [TEXT/R*ch]

  1. /* -*-C-*- fillrect.h */
  2. /*-->fillrect*/
  3. /**********************************************************************/
  4. /****************************** fillrect ******************************/
  5. /**********************************************************************/
  6. #include "dvihead.h"
  7. #include "commands.h"
  8. #include "gendefs.h"
  9. #include "gblprocs.h"
  10. #include "egblvars.h"
  11. #include "m72.h"
  12. #include "mac-specific.h"
  13. #include "Scale_rect.h"
  14.  
  15.  
  16. void
  17. fillrect(x,y,width,height)
  18. COORDINATE x,y,width,height;        /* lower left corner, size */
  19.  
  20. /***********************************************************************
  21. With the page origin (0,0) at the lower-left corner of the bitmap,  draw
  22. a filled rectangle at (x,y).
  23. ***********************************************************************/
  24.  
  25. {
  26.     Rect    dest, print_dest, preview_dest;
  27.     
  28.     SetRect( &dest, x, YSIZE - y - height, x + width, YSIZE - y );
  29.     if (g_draw_offscreen)
  30.     {
  31.         SetPort( &g_offscreen_GrafPort );
  32.         PaintRect( &dest );
  33.     }
  34.     else
  35.     {
  36.         Scale_rect( &dest, &print_dest, &preview_dest );
  37.         if (g_preview)
  38.         {
  39.             SetPort( g_page_window );
  40.             PaintRect( &preview_dest );
  41.         }
  42.         SetPort( (GrafPtr) g_print_port_p );
  43.         PaintRect( &print_dest );
  44.     }
  45. }
  46.  
  47.