Make labelMode, textAlignment, and currentStyle public variables.
This commit is contained in:
@@ -129,7 +129,6 @@ public class MTMathAtom: NSObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public var nucleus: String = ""
|
public var nucleus: String = ""
|
||||||
// public var childAtoms = [MTMathAtom]() // atoms that fused to create this one
|
|
||||||
public var indexRange = NSRange(location: 0, length: 0) // indexRange in list that this atom tracks:
|
public var indexRange = NSRange(location: 0, length: 0) // indexRange in list that this atom tracks:
|
||||||
|
|
||||||
var fontStyle: MTFontStyle = .defaultStyle
|
var fontStyle: MTFontStyle = .defaultStyle
|
||||||
@@ -143,7 +142,6 @@ public class MTMathAtom: NSObject {
|
|||||||
self.superScript = MTMathList(atom.superScript)
|
self.superScript = MTMathList(atom.superScript)
|
||||||
self.indexRange = atom.indexRange
|
self.indexRange = atom.indexRange
|
||||||
self.fontStyle = atom.fontStyle
|
self.fontStyle = atom.fontStyle
|
||||||
// self.childAtoms = [MTMathAtom](atom.childAtoms)
|
|
||||||
self.fusedAtoms = atom.fusedAtoms
|
self.fusedAtoms = atom.fusedAtoms
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ public class MTMathUILabel : MTView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** The Label mode for the label. The default mode is Display */
|
/** The Label mode for the label. The default mode is Display */
|
||||||
var labelMode = MTMathUILabelMode.display {
|
public var labelMode = MTMathUILabelMode.display {
|
||||||
didSet {
|
didSet {
|
||||||
self.invalidateIntrinsicContentSize()
|
self.invalidateIntrinsicContentSize()
|
||||||
self.setNeedsLayout()
|
self.setNeedsLayout()
|
||||||
@@ -148,7 +148,7 @@ public class MTMathUILabel : MTView {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Horizontal alignment for the text. The default is align left. */
|
/** Horizontal alignment for the text. The default is align left. */
|
||||||
var textAlignment = MTTextAlignment.left {
|
public var textAlignment = MTTextAlignment.left {
|
||||||
didSet {
|
didSet {
|
||||||
self.invalidateIntrinsicContentSize()
|
self.invalidateIntrinsicContentSize()
|
||||||
self.setNeedsLayout()
|
self.setNeedsLayout()
|
||||||
@@ -158,7 +158,7 @@ public class MTMathUILabel : MTView {
|
|||||||
/** The internal display of the MTMathUILabel. This is for advanced use only. */
|
/** The internal display of the MTMathUILabel. This is for advanced use only. */
|
||||||
var displayList: MTMathListDisplay? = nil
|
var displayList: MTMathListDisplay? = nil
|
||||||
|
|
||||||
var currentStyle:MTLineStyle {
|
public var currentStyle:MTLineStyle {
|
||||||
switch labelMode {
|
switch labelMode {
|
||||||
case .display: return .display
|
case .display: return .display
|
||||||
case .text: return .text
|
case .text: return .text
|
||||||
@@ -273,17 +273,4 @@ public class MTMathUILabel : MTView {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// #if os(macOS)
|
|
||||||
// override public var isFlipped: Bool { false }
|
|
||||||
// func setNeedsDisplay() { self.needsDisplay = true }
|
|
||||||
// func setNeedsLayout() { self.needsLayout = true }
|
|
||||||
// override public func layout() {
|
|
||||||
// self._layoutSubviews()
|
|
||||||
// super.layout()
|
|
||||||
// }
|
|
||||||
// #else
|
|
||||||
// override public func layoutSubviews() { self._layoutSubviews() }
|
|
||||||
// override public func sizeThatFits(_ size: CGSize) -> CGSize { self._sizeThatFits(size) }
|
|
||||||
// #endif
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user