Another fix attempt.

This commit is contained in:
Michael Griebling
2023-01-18 09:20:08 -05:00
parent 13a8a9097c
commit a31f3ae7b6
2 changed files with 10 additions and 9 deletions

View File

@@ -15,6 +15,7 @@ public typealias MTView = UIView
public typealias MTColor = UIColor
public typealias MTBezierPath = UIBezierPath
public typealias MTLabel = UILabel
public typealias MTEdgeInsets = UIEdgeInsets
public typealias MTRect = CGRect
let MTEdgeInsetsZero = UIEdgeInsets.zero

View File

@@ -238,13 +238,9 @@ public class MTMathUILabel : MTView {
context.restoreGState()
}
#if os(iOS)
override public func layoutSubviews() { _layoutSubviews() }
#endif
func _layoutSubviews() {
if mathList != nil {
_displayList = MTTypesetter.createLineForMathList(mathList, font: font, style: currentStyle)
if _mathList != nil {
_displayList = MTTypesetter.createLineForMathList(_mathList, font: font, style: currentStyle)
_displayList!.textColor = textColor
var textX = CGFloat(0)
switch self.textAlignment {
@@ -279,16 +275,20 @@ public class MTMathUILabel : MTView {
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 setNeedsLayout() { self.needsLayout = true }
public override var fittingSize: CGSize { _sizeThatFits(CGSizeZero) }
override public var isFlipped: Bool { false }
override public func layout() {
self._layoutSubviews()
super.layout()
}
#endif
#else
public override var intrinsicContentSize: CGSize { _sizeThatFits(CGSizeZero) }
override public func layoutSubviews() { _layoutSubviews() }
#endif
}