Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
7640 views
1
#import "MuAnnotSelectView.h"
2
3
@implementation MuAnnotSelectView
4
{
5
MuAnnotation *annot;
6
CGSize pageSize;
7
UIColor *color;
8
}
9
10
- (id)initWithAnnot:(MuAnnotation *)_annot pageSize:(CGSize)_pageSize
11
{
12
self = [super initWithFrame:CGRectMake(0.0, 0.0, 100.0, 100.0)];
13
if (self)
14
{
15
[self setOpaque:NO];
16
annot = [_annot retain];
17
pageSize = _pageSize;
18
color = [[UIColor colorWithRed:0x44/255.0 green:0x44/255.0 blue:1.0 alpha:1.0] retain];
19
}
20
return self;
21
}
22
23
-(void) dealloc
24
{
25
[annot release];
26
[color release];
27
[super dealloc];
28
}
29
30
- (void)drawRect:(CGRect)rect
31
{
32
CGSize scale = fitPageToScreen(pageSize, self.bounds.size);
33
CGContextRef cref = UIGraphicsGetCurrentContext();
34
CGContextScaleCTM(cref, scale.width, scale.height);
35
[color set];
36
CGContextStrokeRect(cref, annot.rect);
37
}
38
39
@end
40
41