home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1995 August / NEBULA.mdf / SourceCode / BrainRulers / Source / CrosshairView.m < prev    next >
Encoding:
Text File  |  1994-06-07  |  825 b   |  36 lines

  1. #import "CrosshairView.h"
  2. #import <dpsclient/psops.h>
  3.  
  4. @implementation CrosshairView
  5.  
  6. - drawSelf:(NXRect *)rects :(int)rectCount
  7. {
  8.     float    x0,y0,x1,y1,yScale;
  9.     x0 = rects[0].origin.x;
  10.     y0 = rects[0].origin.y;
  11.     x1 = x0 + rects[0].size.width;
  12.     y1 = y0 + rects[0].size.height;
  13.     
  14.     PSsetgray(NX_BLACK);
  15.     PSsetlinewidth(0.0);
  16.  
  17.     yScale = bounds.size.height / bounds.size.width;
  18.     PSscale(1,yScale);
  19.  
  20.     PSarc(bounds.size.width/2, bounds.size.height/yScale/2, bounds.size.width/2, 0,360);
  21.     PSclip();
  22.     PSmoveto(0,0);
  23.     PSlineto(bounds.size.width, bounds.size.height/yScale);
  24.     PSmoveto(0, bounds.size.height/yScale);
  25.     PSlineto(bounds.size.width, 0);
  26.     PSmoveto(bounds.size.width/2,0);
  27.     PSrlineto(0, bounds.size.height/yScale);
  28.     PSmoveto(0, bounds.size.height/yScale/2);
  29.     PSrlineto(bounds.size.width, 0);
  30.     PSstroke();
  31.     
  32.     return self;
  33. }
  34.  
  35. @end
  36.