Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed a rendering issue where CG would generate unwanted line artifac…

…ts when two lines overlapped.
  • Loading branch information...
commit d32318f1f45f6a21dc70247a2c446e9c9829b5d3 1 parent 94c25fd
Brian Coyner authored
View
2  CoreAnimationFunHouse/BTSLissajousLayer.m
@@ -75,7 +75,6 @@ - (void)drawInContext:(CGContextRef)context
CGFloat increment = 2 * M_PI / (a * b * 40);
for (CGFloat t = 0.0; t < 2 * M_PI + increment; t = t + increment) {
-
CGFloat x = amplitude * sin(a * t + delta);
CGFloat y = amplitude * sin(b * t);
if (t == 0.0) {
@@ -86,6 +85,7 @@ - (void)drawInContext:(CGContextRef)context
}
CGContextAddPath(context, path);
+ CGContextSetLineJoin(context, kCGLineJoinBevel);
CGContextStrokePath(context);
CFRelease(path);
}
View
4 CoreAnimationFunHouse/BTSLissajousViewController.m
@@ -35,11 +35,11 @@ - (void)viewDidLoad
BTSLissajousLayer *layer = (BTSLissajousLayer *)[[[self view] viewWithTag:100] layer];
- [_amplitudeSlider setMinimumValue:0.0];
+ [_amplitudeSlider setMinimumValue:1.0];
[_amplitudeSlider setMaximumValue:[layer bounds].size.height / 2.0];
[_amplitudeSlider setValue:[_amplitudeSlider maximumValue] / 2.0];
- [_aStepper setMinimumValue:0.0];
+ [_aStepper setMinimumValue:1.0];
[_aStepper setMaximumValue:10.0];
[_aStepper setValue:1.0];
Please sign in to comment.
Something went wrong with that request. Please try again.