summaryrefslogtreecommitdiff
path: root/platform/ios/Classes/MuAnnotSelectView.m
blob: 88087fddd82582d9898a122d5985a23ca6a4ac99 (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
40
41
42
//
//  MuAnnotSelectView.m
//  MuPDF
//
//  Created by Paul Gardiner on 21/11/2013.
//  Copyright (c) 2013 Artifex Software, Inc. All rights reserved.
//

#import "MuAnnotSelectView.h"

@implementation MuAnnotSelectView

- (id)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