You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So I was working on making it possible, so that you could insert an editable Matrix in your editable math label. What I did was inserting this code into MTEditableMathLabel:
if (_insertionIndex.subIndexType == kMTSubIndexTypeDenominator) {
if (atom.type == kMTMathAtomRelation) {
// pull the insertion index out
_insertionIndex = [[_insertionIndex levelDown] next];
}
}
if (atom) {
if (![self updatePlaceholderIfPresent:atom]) {
// If a placeholder wasn't updated then insert the new element.
[self.mathList insertAtom:atom atListIndex:_insertionIndex];
}
if (atom.type == kMTMathAtomFraction) {
// go to the numerator
_insertionIndex = [_insertionIndex levelUpWithSubIndex:[MTMathListIndex level0Index:0] type:kMTSubIndexTypeNumerator];
} else {
_insertionIndex = _insertionIndex.next;
}
}
self.label.mathList = self.mathList;
[self insertionPointChanged];
if ([self.delegate respondsToSelector:@selector(textModified:)]) {
[self.delegate textModified:self];
}
NSMutableArray<NSMutableArray<MTMathList*>*>* rows = [[NSMutableArray alloc] initWithCapacity:(NSInteger)height];
for (int y = 0; y < height; y++)
{
NSMutableArray<MTMathList*>* row = [[NSMutableArray alloc] initWithCapacity:(NSInteger)width];
for (int x = 0; x < width; x++)
{
MTMathList* list = [MTMathList new];
[list addAtom:[self placeholder]];
row[x] = list;
}
rows[y] = row;
}
MTMathAtom* table = [MTMathAtomFactory tableWithEnvironment:envname rows:rows error:&error];
return table;
}`
This displays the matrix fine, but when I try to select one of the Values in the matrix I get this error, which I have no idea where it is coming from.
'MTLine type regular inside an MTLine - shouldn't happen'
But the display is exactly the way I want it to be. What is wrong here ? I really need help on this please. Thanks a lot for any help in advance.
The text was updated successfully, but these errors were encountered:
So I was working on making it possible, so that you could insert an editable Matrix in your editable math label. What I did was inserting this code into MTEditableMathLabel:
`- (void) insertMatrix: (int)rows :(int)columns :(NSString )type
{
MTMathAtom atom = [MTMathAtomFactory placeholderMatrix:columns :rows :type];
}`
and this code into MTMathAtomFactory
`+ (MTMathAtom *)placeholderMatrix: (int)width :(int)height :(NSString )envname
{
NSError error;
}`
This displays the matrix fine, but when I try to select one of the Values in the matrix I get this error, which I have no idea where it is coming from.
'MTLine type regular inside an MTLine - shouldn't happen'
But the display is exactly the way I want it to be. What is wrong here ? I really need help on this please. Thanks a lot for any help in advance.
The text was updated successfully, but these errors were encountered: