Added MPDisplayExtension Category to MPExpression and MPFunction Added Methods to Invalidate the Cache to MPExpressionLayout and MPFunctionLayout
34 lines
1.1 KiB
Objective-C
34 lines
1.1 KiB
Objective-C
//
|
|
// 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
|