-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModeImageView.m
More file actions
53 lines (43 loc) · 1.29 KB
/
ModeImageView.m
File metadata and controls
53 lines (43 loc) · 1.29 KB
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
//
// ModeImageView.m
// ModeMaker
//
// Created by David Hirsch on 9/20/09.
// Copyright 2009 Western Washington University. All rights reserved.
//
#import "ModeImageView.h"
#import "ModeMakerDoc.h"
@implementation ModeImageView
- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
if (self) {
// Initialization code here.
}
return self;
}
- (void)drawRect:(NSRect)rect {
// Drawing code here.
ModeMakerDoc *doc = [[[self window] windowController] document];
if (doc) {
NSRect myBounds = [self bounds];
[[doc backgroundColor] set];
[NSBezierPath fillRect:myBounds];
/* For Debugging
NSBezierPath *gridPath = [NSBezierPath bezierPath];
short i;
for (i=100; i <= myBounds.size.height; i+=100) {
[gridPath moveToPoint:NSMakePoint(myBounds.origin.x, myBounds.origin.y + i)];
[gridPath lineToPoint:NSMakePoint(myBounds.origin.x + myBounds.size.width, myBounds.origin.y + i)];
}
for (i=100; i <= myBounds.size.width; i+=100) {
[gridPath moveToPoint:NSMakePoint(myBounds.origin.x + i, myBounds.origin.y)];
[gridPath lineToPoint:NSMakePoint(myBounds.origin.x + i, myBounds.size.height + myBounds.origin.y)];
}
[[NSColor grayColor] setStroke];
[gridPath stroke];
*/
[doc drawPhases];
}
}
- (BOOL) isOpaque {return YES;}
@end