Archived
1

Renamed NSIndexPath+MPRemoveFirstIndex Category to NSIndexPath+MPReverseIndexPath

Added MPDisplayExtension Category to MPExpression and MPFunction
Added Methods to Invalidate the Cache to MPExpressionLayout and MPFunctionLayout
This commit is contained in:
Kim Wittenburg
2014-04-23 16:05:20 +02:00
parent e048deef1f
commit fa499d299c
9 changed files with 140 additions and 14 deletions

View File

@@ -0,0 +1,33 @@
//
// MPExpression+MPDisplayExtension.m
// MathPad
//
// Created by Kim Wittenburg on 23.04.14.
// Copyright (c) 2014 Kim Wittenburg. All rights reserved.
//
#import "MPDisplayExtension.h"
@implementation MPExpression (MPDisplayExtension)
- (void)subexpressionChangedAtRangePath:(MPRangePath *)rangePath
{
NSUInteger index = [self.parent indexOfChild:self];
NSIndexPath *newLocation = [rangePath.location indexPathByPrecedingIndex:index];
[self.parent subexpressionChangedAtRangePath:[[MPRangePath alloc] initWithLocation:newLocation
length:rangePath.length]];
}
@end
@implementation MPFunction (MPDisplayExtension)
- (void)subexpressionChangedAtRangePath:(MPRangePath *)rangePath
{
NSUInteger index = [self.parent indexOfSymbol:self];
NSIndexPath *newLocation = [rangePath.location indexPathByPrecedingIndex:index];
[self.parent subexpressionChangedAtRangePath:[[MPRangePath alloc] initWithLocation:newLocation
length:rangePath.length]];
}
@end