Archived
1

Corrected MPExpression -itemAtIndex:referenceFrame:MPSymbolReferenceFrame

Corrected Deformed Number Format
Added "arcsin", "arccos", "arctan", "lg", "log", "ln" Elementary Functions
This commit is contained in:
Kim Wittenburg
2014-12-11 15:32:06 +01:00
parent 98e4a6dde6
commit c367b1dbe8
7 changed files with 105 additions and 38 deletions

View File

@@ -259,9 +259,10 @@
// Set the text matrix
CGContextSetTextMatrix(context, CGAffineTransformIdentity);
// Track the x position
// Track the x position and the bounds of the last element
CGFloat x = 0;
NSRect lastElementBounds = NSMakeRect(0, kMPEmptyBoxYOrigin, kMPEmptyBoxWidth, kMPEmptyBoxHeight);
for (NSUInteger index = 0; index < self.expression.countElements; index++) {
// The current element
id element = [self.expression elementAtIndex:index];
@@ -279,17 +280,16 @@
CTLineDraw(line, context);
CFRelease(line);
if (index < self.expression.countElements-1 && [[self.expression elementAtIndex:index+1] isKindOfClass:[MPPowerFunction class]]) {
MPPowerFunctionLayout *layout = (MPPowerFunctionLayout *)[self childLayoutAtIndex:index+1];
layout.baseBounds = elementBounds;
}
} else {
// Let the child layout draw itself
MPLayout *layout = [self childLayoutAtIndex:index];
if ([layout isKindOfClass:[MPPowerFunctionLayout class]]) {
((MPPowerFunctionLayout *)layout).baseBounds = lastElementBounds;
}
[layout drawAtPoint:NSMakePoint(x, 0)];
}
x += elementBounds.size.width;
lastElementBounds = elementBounds;
}
CGContextRestoreGState(context);
}