// LineView.m
// Part of Risk by Mike Ferris

#import "LineView.h"
#import <dpsclient/psops.h>

@implementation LineView

- setLineWidth:(float)lw
{
	lineWidth = lw;
	[self display];
	return self;
}

- drawSelf:(const NXRect *)rects :(int)rectCount
{
	NXCoord mp, begin, end;
	
	NXDrawWhiteBezel(&bounds, NULL);
	mp = bounds.origin.y + (bounds.size.height/2);
	begin = bounds.origin.x + 2;
	end = bounds.origin.x + bounds.size.width - 2;
	PSsetgray(NX_BLACK);
	PSsetlinewidth(lineWidth);
	PSmoveto(begin, mp);
	PSlineto(end, mp);
	PSclosepath();
	PSstroke();
	
	return self;
}

@end
