Archived
1

Prepared to implement improved keyboard navigation

This commit is contained in:
Kim Wittenburg
2014-09-07 16:48:18 +02:00
parent acd12fcc32
commit 88f54b742f
3 changed files with 23 additions and 6 deletions

View File

@@ -23,6 +23,16 @@
return (MPSumFunction *)self.function;
}
- (NSUInteger)indexOfLeadingChild
{
return 2;
}
- (NSUInteger)indexOfTrailingChild
{
return 2;
}
- (CTLineRef)line
{
CTLineRef line = [self lineForPrivateCacheIndex:0 generator:^CTLineRef{
@@ -75,7 +85,7 @@
childBounds.origin.x += childOffset.x;
childBounds.origin.y += childOffset.y;
if (NSMouseInRect(point, childBounds, self.flipped)) {
NSPoint pointInChild = NSMakePoint(point.x + childOffset.x, point.y + childOffset.y);
NSPoint pointInChild = NSMakePoint(point.x - childOffset.x, point.y - childOffset.y);
NSIndexPath *subPath = [childLayout indexPathForMousePoint:pointInChild];
return [subPath indexPathByPreceedingIndex:index];
}