All pastes #2081596 Raw Edit

Someone

public text v1 · immutable
#2081596 ·published 2011-09-20 16:06 UTC
rendered paste body
//
//  WaveView.m
//  Wave
//
//  Created by Isha on 20.09.11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "WaveView.h"


@implementation WaveView

@synthesize ySlider,ycSlider,wSlider,xSlider;

- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        NSLog(@"Init called");
        x=400;
        yc=50;
        w=0;
        y=200;
    }
    return self;
}


// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect
{
    if (x == 0 && yc == 0 || w== 0 || y == 0) {
        NSLog(@"Everything 0");
    }
    NSLog(@"x:%f y:%f yc:%f w: %f", x,y,yc,w);
    while (w<=rect.size.width) {
        CGContextRef context = UIGraphicsGetCurrentContext();
        CGMutablePathRef path = CGPathCreateMutable();
        CGPathMoveToPoint(path, nil, w,y/2);
        CGPathAddQuadCurveToPoint(path, nil, w+x/4, -yc,w+ x/2, y/2);
        CGPathMoveToPoint(path, nil, w+x/2,y/2);
        CGPathAddQuadCurveToPoint(path, nil, w+3*x/4, y+yc, w+x, y/2);
        CGContextAddPath(context, path);
        CGContextDrawPath(context, kCGPathStroke);
        w+=x;
    }
    NSLog(@"Jumping out!");
}



- (IBAction)changeSliderX
{

}

- (IBAction)changeSliderY
{
    
}

- (IBAction)changeSliderYC
{
    
}

- (IBAction)changeSliderW
{
    
}

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


@end