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:
33
MathPad/MPDisplayExtension.m
Normal file
33
MathPad/MPDisplayExtension.m
Normal 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
|
||||
Reference in New Issue
Block a user