Added Lots of Documentation
Added some nice to haves Improved and Unified General Code Layout
This commit is contained in:
@@ -10,9 +10,12 @@
|
||||
|
||||
#import "MPPowerFunction.h"
|
||||
|
||||
|
||||
#define kPowerFunctionExponentXOffset 1
|
||||
#define kPowerFunctionTrailingOffset 2
|
||||
|
||||
|
||||
|
||||
@implementation MPPowerFunctionLayout
|
||||
|
||||
- (NSRect)baseBounds
|
||||
@@ -23,16 +26,19 @@
|
||||
return _baseBounds;
|
||||
}
|
||||
|
||||
|
||||
- (MPPowerFunction *)powerFunction
|
||||
{
|
||||
return (MPPowerFunction *)self.function;
|
||||
}
|
||||
|
||||
|
||||
- (NSIndexSet *)indexesOfRemainingChildren
|
||||
{
|
||||
return [NSIndexSet indexSetWithIndex:0];
|
||||
}
|
||||
|
||||
|
||||
#warning Broken Power Layout
|
||||
- (NSPoint)offsetOfChildLayoutAtIndex:(NSUInteger)index
|
||||
{
|
||||
@@ -41,16 +47,19 @@
|
||||
return NSMakePoint(kPowerFunctionExponentXOffset, y);
|
||||
}
|
||||
|
||||
|
||||
- (BOOL)childAtIndexUsesSmallSize:(NSUInteger)index
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
|
||||
- (NSIndexPath *)indexPathForLocalMousePoint:(NSPoint)point
|
||||
{
|
||||
return [[NSIndexPath indexPathWithIndex:0] indexPathByAddingIndex:0];
|
||||
}
|
||||
|
||||
|
||||
- (NSRect)generateBounds
|
||||
{
|
||||
NSRect exponentBounds = [self childLayoutAtIndex:0].bounds;
|
||||
@@ -59,9 +68,8 @@
|
||||
return NSMakeRect(0, 0, width, height);
|
||||
}
|
||||
|
||||
|
||||
- (void)draw
|
||||
{
|
||||
[[NSBezierPath bezierPathWithRect:self.bounds] stroke];
|
||||
}
|
||||
{}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user