From 94c25fd83a45ebcefea5caab8af8b129c1ff8f5c Mon Sep 17 00:00:00 2001 From: Brian Coyner Date: Sun, 30 Oct 2011 13:59:45 -0500 Subject: [PATCH] Minor updates. --- CoreAnimationFunHouse/BTSLissajousLayer.m | 5 ++--- CoreAnimationFunHouse/BTSLissajousViewController.m | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/CoreAnimationFunHouse/BTSLissajousLayer.m b/CoreAnimationFunHouse/BTSLissajousLayer.m index bb8a5d0..e04590f 100644 --- a/CoreAnimationFunHouse/BTSLissajousLayer.m +++ b/CoreAnimationFunHouse/BTSLissajousLayer.m @@ -64,14 +64,13 @@ - (void)drawInContext:(CGContextRef)context CGContextSetLineWidth(context, 2.0); CGContextSetShadow(context, CGSizeMake(5.0, 2.5), 5.0); - // The layer redraws the content using the current animation's interpolated values. The interpolated + // The layer redraws the curve using the current animation's interpolated values. The interpolated // values are retrieved from the layer's "presentationLayer". CGFloat amplitude = [[(NSValue *)[self presentationLayer] valueForKey:kBTSLissajouseLayerAmplitude] floatValue]; - CGFloat a = [[(NSValue *)[self presentationLayer] valueForKey:kBTSLissajouseLayerA] floatValue]; CGFloat b = [[(NSValue *)[self presentationLayer] valueForKey:kBTSLissajouseLayerB] floatValue]; - CGFloat delta = [[(NSValue *)[self presentationLayer] valueForKey:kBTSLissajouseLayerDelta] floatValue]; + CGMutablePathRef path = CGPathCreateMutable(); CGFloat increment = 2 * M_PI / (a * b * 40); diff --git a/CoreAnimationFunHouse/BTSLissajousViewController.m b/CoreAnimationFunHouse/BTSLissajousViewController.m index c5b7809..ea41628 100644 --- a/CoreAnimationFunHouse/BTSLissajousViewController.m +++ b/CoreAnimationFunHouse/BTSLissajousViewController.m @@ -36,7 +36,7 @@ - (void)viewDidLoad BTSLissajousLayer *layer = (BTSLissajousLayer *)[[[self view] viewWithTag:100] layer]; [_amplitudeSlider setMinimumValue:0.0]; - [_amplitudeSlider setMaximumValue:[layer bounds].size.height / 2.0 - 5.0]; + [_amplitudeSlider setMaximumValue:[layer bounds].size.height / 2.0]; [_amplitudeSlider setValue:[_amplitudeSlider maximumValue] / 2.0]; [_aStepper setMinimumValue:0.0]; @@ -91,7 +91,6 @@ - (IBAction)updateA:(id)sender { float value = [(UIStepper *)sender value]; [_aValueLabel setText:[NSString stringWithFormat:@"%0.0f", [_aStepper value]]]; - [layer setA:(CGFloat)value]; }