summaryrefslogtreecommitdiff
path: root/platform/ios/Classes/MuAnnotSelectView.m
blob: a02adbf71662af8906df523d5d1a2d9a714083c2 (plain)
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
#import "MuAnnotSelectView.h"

@implementation MuAnnotSelectView
{
	MuAnnotation *annot;
	CGSize pageSize;
	UIColor *color;
}

- (instancetype)initWithAnnot:(MuAnnotation *)_annot pageSize:(CGSize)_pageSize
{
	self = [super initWithFrame:CGRectMake(0.0, 0.0, 100.0, 100.0)];
	if (self)
	{
		[self setOpaque:NO];
		annot = [_annot retain];
		pageSize = _pageSize;
		color = [[UIColor colorWithRed:0x44/255.0 green:0x44/255.0 blue:1.0 alpha:1.0] retain];
	}
	return self;
}

-(void) dealloc
{
	[annot release];
	[color release];
	[super dealloc];
}

- (void)drawRect:(CGRect)rect
{
	CGSize scale = fitPageToScreen(pageSize, self.bounds.size);
	CGContextRef cref = UIGraphicsGetCurrentContext();
	CGContextScaleCTM(cref, scale.width, scale.height);
	[color set];
	CGContextStrokeRect(cref, annot.rect);
}

@end