//
//  HypnoticView.m
//  Hypnosis
//
//  Created by Richard Wicentowski on 2/2/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "HypnoticView.h"


@implementation HypnoticView


- (void)drawRect:(CGRect)rect {
	// What rectangle am I filling?
	CGRect bounds = self.bounds;
	
	// Where is the center of this rectangle?
	CGPoint center;
	center.x = bounds.origin.x + bounds.size.width / 2.0;
	center.y = bounds.origin.y + bounds.size.height / 2.0;
	
	// What is the maximum circle size?
	float maxRadius = hypot(bounds.size.width, bounds.size.height)/2.0;
	
	// What context are we drawing to?
	CGContextRef context = UIGraphicsGetCurrentContext();
	
	// Set the thickness and color of my lines
	CGContextSetLineWidth(context, 10);
	[[UIColor redColor] setStroke];
	
	// Draw concentric circles
	for (float curRadius = maxRadius; curRadius > 0; curRadius-=20) {
		CGContextAddArc(context, center.x, center.y, 
						curRadius, 0, 2*M_PI, 0);
		CGContextStrokePath(context);
	}

}


- (void)dealloc {
    [super dealloc];
}


@end
