-
Notifications
You must be signed in to change notification settings - Fork 118
/
Copy pathSFMArrowView.m
39 lines (30 loc) · 967 Bytes
/
SFMArrowView.m
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
//
// SFMArrowView.m
// Stockfish
//
// Created by Daylen Yang on 1/26/14.
// Copyright (c) 2014 Daylen Yang. All rights reserved.
//
#import "SFMArrowView.h"
#import "NSBezierPath+Arrowhead.h"
@implementation SFMArrowView
- (void)drawRect:(NSRect)dirtyRect
{
[[NSColor colorWithSRGBRed:1 green:0 blue:0 alpha:0.5] set];
CGFloat arrowLineWidth = self.squareSideLength * 0.2 * self.weight;
NSBezierPath *path = [NSBezierPath bezierPathWithArrowFromPoint:self.fromPoint
toPoint:self.toPoint
tailWidth:arrowLineWidth
headWidth:2.5 * arrowLineWidth
headLength:2.5 * arrowLineWidth];
[path fill];
}
- (NSView *)hitTest:(NSPoint)aPoint
{
return nil;
}
- (BOOL)isFlipped
{
return YES;
}
@end