
/* Generated by Interface Builder */

#import "SafetyView.h"
#import	"CardHolder.h"
#import	<assert.h>


@implementation SafetyView


+ new
{


	self = [ super new ];
	rotatedFlag = NO;
	
	return self;
}


- setRotatedFlag:( BOOL )flag
{


	if( rotatedFlag = flag ) {
		[ self rotateTo:90.0 ];
		[ self setDrawOrigin: -NX_HEIGHT( &bounds ) :0.0 ];
	} else {
		[ self rotateTo:0.0 ];
		[ self setDrawOrigin:0.0 :0.0 ];
	}
	
	return self;
}


												// One of the advantages of having
												//	the source.  I know what the super class
												//	does so I can take advantage of it.
- drawSelf:( const NXRect * )rects :( int )rectCount
{

	BOOL	performDraw = YES;
	
	
	if([ superview respondsTo:@selector(subviewVisible:)])
		if( ![ superview subviewVisible:self ])
			performDraw = NO;
	
	if( performDraw ) 
		if( rotatedFlag ) {
			assert( rotatedBottomFaceBitmap );
			[ rotatedBottomFaceBitmap composite:NX_SOVER toPoint:&bounds.origin ];
		} else
			[ super drawSelf:rects :rectCount ];
	
	return self;
}


@end
