forked from SeriousMonster/moriarty
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLineView.h
53 lines (43 loc) · 1.29 KB
/
LineView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
//
// LineView.h
//
// Created by Tyler Neylon on 4/5/11.
//
// View to draw a single line.
//
// Sample usage:
//
// CGPoint a = CGPointMake(10, 10);
// CGPoint b = CGPointMake(50, 100);
// LineView *lineView = [LineView lineFromPoint:a toPoint:b];
// lineView.color = [UIColor blueColor];
// [self.view addSubview:lineView];
//
#import <Foundation/Foundation.h>
@interface LineView : UIView {
@private
// strong
UIColor *color;
UIColor *shadowColor;
CGFloat lineWidth;
CGPoint a;
CGPoint b;
BOOL drawShadow;
CGSize shadowOffset;
CGFloat shadowBlurRadius;
// This defaults to 1; increase for heavier shadowing.
int shadowMultiplicity;
}
@property (nonatomic, retain) UIColor *color;
@property (nonatomic) CGFloat lineWidth;
@property (nonatomic, readonly) CGPoint a;
@property (nonatomic, readonly) CGPoint b;
@property (nonatomic) int shadowMultiplicity;
+ (LineView *)lineFromPoint:(CGPoint)a toPoint:(CGPoint)b;
// The image will be transparent except for the line, and
// have padding around the line. It will be sized so that,
// when placed with frameOrigin = (0,0), the line will have
// the coordinates given in the constructor.
- (UIImage *)getImage;
- (void)setShadowOffset:(CGSize)offset blurRadius:(CGFloat)blurRadius color:(UIColor *)color;
@end