2
0

Cleanup, renaming restructuring, etc.

This commit is contained in:
Maarten Billemont
2017-05-07 18:36:01 -04:00
parent f86210f5da
commit fcbb93762a
62 changed files with 1599 additions and 1492 deletions

View File

@@ -18,9 +18,13 @@
#import "MPGradientView.h"
@implementation MPGradientView {
NSGradient *gradient;
}
@interface MPGradientView()
@property(nonatomic, strong) NSGradient *gradient;
@end
@implementation MPGradientView
- (id)initWithFrame:(NSRect)frame {
@@ -51,28 +55,28 @@
- (void)setStartingColor:(NSColor *)startingColor {
_startingColor = startingColor;
gradient = nil;
self.gradient = nil;
[self setNeedsDisplay:YES];
}
- (void)setEndingColor:(NSColor *)endingColor {
_endingColor = endingColor;
gradient = nil;
self.gradient = nil;
[self setNeedsDisplay:YES];
}
- (void)setAngle:(NSInteger)angle {
_angle = angle;
gradient = nil;
self.gradient = nil;
[self setNeedsDisplay:YES];
}
- (void)setRatio:(CGFloat)ratio {
_ratio = ratio;
gradient = nil;
self.gradient = nil;
[self setNeedsDisplay:YES];
}
@@ -84,7 +88,7 @@
return;
}
[(gradient?: (gradient = [[NSGradient alloc] initWithColorsAndLocations:
[(self.gradient?: (self.gradient = [[NSGradient alloc] initWithColorsAndLocations:
self.startingColor, (CGFloat)0.f,
[self.startingColor blendedColorWithFraction:0.5f ofColor:self.endingColor], self.ratio,
self.endingColor, (CGFloat)1.f, nil]))