Fixed a "choose" line thickness issue.
Mac actually draws a line of zero width.
This commit is contained in:
@@ -7,6 +7,8 @@ so the equations are rendered exactly as LaTeX would render them.
|
|||||||
`
|
`
|
||||||
SwiftMath` is a Swift translation of the latest `iosMath` v0.9.5 release but includes bug fixes
|
SwiftMath` is a Swift translation of the latest `iosMath` v0.9.5 release but includes bug fixes
|
||||||
and enhancements like a new \lbar (lambda bar) character and cyrillic alphabet support.
|
and enhancements like a new \lbar (lambda bar) character and cyrillic alphabet support.
|
||||||
|
The original `iosMath` test suites have also been translated to Swift and run without errors.
|
||||||
|
Note: Error test conditions are ignored to avoid tagging everything with silly `throw`s.
|
||||||
Please let me know of any bugs or bug fixes that you find.
|
Please let me know of any bugs or bug fixes that you find.
|
||||||
|
|
||||||
`SwiftMath` prepackages everything needed for direct access via the Swift Package Manager.
|
`SwiftMath` prepackages everything needed for direct access via the Swift Package Manager.
|
||||||
|
|||||||
@@ -369,11 +369,14 @@ class MTFractionDisplay : MTDisplay {
|
|||||||
self.textColor?.setStroke()
|
self.textColor?.setStroke()
|
||||||
|
|
||||||
// draw the horizontal line
|
// draw the horizontal line
|
||||||
|
// Note: line thickness of 0 draws the thinnest possible line - we want no line so check for 0s
|
||||||
|
if self.lineThickness > 0 {
|
||||||
let path = MTBezierPath()
|
let path = MTBezierPath()
|
||||||
path.move(to: CGPointMake(self.position.x, self.position.y + self.linePosition))
|
path.move(to: CGPointMake(self.position.x, self.position.y + self.linePosition))
|
||||||
path.addLine(to: CGPointMake(self.position.x + self.width, self.position.y + self.linePosition))
|
path.addLine(to: CGPointMake(self.position.x + self.width, self.position.y + self.linePosition))
|
||||||
path.lineWidth = self.lineThickness
|
path.lineWidth = self.lineThickness
|
||||||
path.stroke()
|
path.stroke()
|
||||||
|
}
|
||||||
|
|
||||||
context.restoreGState()
|
context.restoreGState()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -962,7 +962,7 @@ class MTTypesetter {
|
|||||||
var numeratorShiftUp = self.numeratorShiftUp(frac!.hasRule)
|
var numeratorShiftUp = self.numeratorShiftUp(frac!.hasRule)
|
||||||
var denominatorShiftDown = self.denominatorShiftDown(frac!.hasRule)
|
var denominatorShiftDown = self.denominatorShiftDown(frac!.hasRule)
|
||||||
let barLocation = styleFont.mathTable!.axisHeight
|
let barLocation = styleFont.mathTable!.axisHeight
|
||||||
let barThickness = frac!.hasRule ? styleFont.mathTable!.fractionRuleThickness : 0;
|
let barThickness = frac!.hasRule ? styleFont.mathTable!.fractionRuleThickness : 0
|
||||||
|
|
||||||
if frac!.hasRule {
|
if frac!.hasRule {
|
||||||
// This is the difference between the lowest edge of the numerator and the top edge of the fraction bar
|
// This is the difference between the lowest edge of the numerator and the top edge of the fraction bar
|
||||||
|
|||||||
Reference in New Issue
Block a user