Another fix attempt.
This commit is contained in:
@@ -15,6 +15,7 @@ public typealias MTView = UIView
|
|||||||
public typealias MTColor = UIColor
|
public typealias MTColor = UIColor
|
||||||
public typealias MTBezierPath = UIBezierPath
|
public typealias MTBezierPath = UIBezierPath
|
||||||
public typealias MTLabel = UILabel
|
public typealias MTLabel = UILabel
|
||||||
|
public typealias MTEdgeInsets = UIEdgeInsets
|
||||||
public typealias MTRect = CGRect
|
public typealias MTRect = CGRect
|
||||||
|
|
||||||
let MTEdgeInsetsZero = UIEdgeInsets.zero
|
let MTEdgeInsetsZero = UIEdgeInsets.zero
|
||||||
|
|||||||
@@ -238,13 +238,9 @@ public class MTMathUILabel : MTView {
|
|||||||
context.restoreGState()
|
context.restoreGState()
|
||||||
}
|
}
|
||||||
|
|
||||||
#if os(iOS)
|
|
||||||
override public func layoutSubviews() { _layoutSubviews() }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
func _layoutSubviews() {
|
func _layoutSubviews() {
|
||||||
if mathList != nil {
|
if _mathList != nil {
|
||||||
_displayList = MTTypesetter.createLineForMathList(mathList, font: font, style: currentStyle)
|
_displayList = MTTypesetter.createLineForMathList(_mathList, font: font, style: currentStyle)
|
||||||
_displayList!.textColor = textColor
|
_displayList!.textColor = textColor
|
||||||
var textX = CGFloat(0)
|
var textX = CGFloat(0)
|
||||||
switch self.textAlignment {
|
switch self.textAlignment {
|
||||||
@@ -279,16 +275,20 @@ public class MTMathUILabel : MTView {
|
|||||||
return size
|
return size
|
||||||
}
|
}
|
||||||
|
|
||||||
override public var intrinsicContentSize: CGSize { _sizeThatFits(CGSizeZero) }
|
//override public var intrinsicContentSize: CGSize { _sizeThatFits(CGSizeZero) }
|
||||||
|
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
func setNeedsDisplay() { self.needsDisplay = true }
|
func setNeedsDisplay() { self.needsDisplay = true }
|
||||||
func setNeedsLayout() { self.needsLayout = true }
|
func setNeedsLayout() { self.needsLayout = true }
|
||||||
|
public override var fittingSize: CGSize { _sizeThatFits(CGSizeZero) }
|
||||||
override public var isFlipped: Bool { false }
|
override public var isFlipped: Bool { false }
|
||||||
override public func layout() {
|
override public func layout() {
|
||||||
self._layoutSubviews()
|
self._layoutSubviews()
|
||||||
super.layout()
|
super.layout()
|
||||||
}
|
}
|
||||||
#endif
|
#else
|
||||||
|
public override var intrinsicContentSize: CGSize { _sizeThatFits(CGSizeZero) }
|
||||||
|
override public func layoutSubviews() { _layoutSubviews() }
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user