diff options
author | randomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64> | 2012-01-09 11:00:50 +0000 |
---|---|---|
committer | randomguy3 <randomguy3@7c02a99a-9b00-45e3-bf44-6f3dd7fddb64> | 2012-01-09 11:00:50 +0000 |
commit | a8a8dfb90d6a51ae369c042c95162f45754c7c4b (patch) | |
tree | 0e7a5f82febebe7129ebfb015f05b114064c39fd /tikzit/src/osx/SelectBoxLayer.m | |
parent | e1cf0babff63e670e0d550b4072c22649a117fa7 (diff) |
Move tikzit into "trunk" directory
git-svn-id: https://tikzit.svn.sourceforge.net/svnroot/tikzit/trunk@365 7c02a99a-9b00-45e3-bf44-6f3dd7fddb64
Diffstat (limited to 'tikzit/src/osx/SelectBoxLayer.m')
-rw-r--r-- | tikzit/src/osx/SelectBoxLayer.m | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tikzit/src/osx/SelectBoxLayer.m b/tikzit/src/osx/SelectBoxLayer.m new file mode 100644 index 0000000..c198ffa --- /dev/null +++ b/tikzit/src/osx/SelectBoxLayer.m @@ -0,0 +1,48 @@ +// +// SelectBoxLayer.m +// TikZiT +// +// Created by Aleks Kissinger on 14/06/2010. +// Copyright 2010 __MyCompanyName__. All rights reserved. +// + +#import "SelectBoxLayer.h" + + +@implementation SelectBoxLayer + +@synthesize active; + +- (id)init { + [super init]; + box = CGRectMake(0.0f, 0.0f, 0.0f, 0.0f); + active = NO; + return self; +} + +- (void)setSelectBox:(NSRect)r { + box = NSRectToCGRect(r); +} + +- (NSRect)selectBox { + return NSRectFromCGRect(box); +} + +- (void)drawInContext:(CGContextRef)context { + if (active) { + CGContextAddRect(context, box); + + CGContextSetRGBStrokeColor(context, 0.6, 0.6, 0.6, 1); + CGContextSetRGBFillColor(context, 0.8, 0.8, 0.8, 0.2); + CGContextSetLineWidth(context, 1); + + CGContextSetShouldAntialias(context, NO); + CGContextDrawPath(context, kCGPathFillStroke); + } +} + ++ (SelectBoxLayer*)layer { + return [[[SelectBoxLayer alloc] init] autorelease]; +} + +@end |