diff options
author | Aleks Kissinger <aleks0@gmail.com> | 2018-01-04 15:58:21 +0100 |
---|---|---|
committer | Aleks Kissinger <aleks0@gmail.com> | 2018-01-04 15:58:21 +0100 |
commit | 0421a96749743868554d44585050b1b3d04864d2 (patch) | |
tree | 02b0d4442bddee7c65bee0f875783b46610a4aef /tikzit-old/src/osx/SelectBoxLayer.m | |
parent | fecef0396026b80c5aec736171e4842df7518af9 (diff) |
removed website
Diffstat (limited to 'tikzit-old/src/osx/SelectBoxLayer.m')
-rw-r--r-- | tikzit-old/src/osx/SelectBoxLayer.m | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/tikzit-old/src/osx/SelectBoxLayer.m b/tikzit-old/src/osx/SelectBoxLayer.m new file mode 100644 index 0000000..a7abe33 --- /dev/null +++ b/tikzit-old/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 { + if (!(self = [super init])) return nil; + 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]; +} + +@end |