Corrected MPExpression -itemAtIndex:referenceFrame:MPSymbolReferenceFrame
Corrected Deformed Number Format Added "arcsin", "arccos", "arctan", "lg", "log", "ln" Elementary Functions
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user