Minor visibility fixes.
This commit is contained in:
@@ -11,11 +11,11 @@ import Foundation
|
|||||||
|
|
||||||
import UIKit
|
import UIKit
|
||||||
|
|
||||||
typealias MTView = UIView
|
public typealias MTView = UIView
|
||||||
typealias MTColor = UIColor
|
public typealias MTColor = UIColor
|
||||||
typealias MTBezierPath = UIBezierPath
|
public typealias MTBezierPath = UIBezierPath
|
||||||
typealias MTLabel = UILabel
|
public typealias MTLabel = UILabel
|
||||||
typealias MTRect = CGRect
|
public typealias MTRect = CGRect
|
||||||
|
|
||||||
let MTEdgeInsetsZero = UIEdgeInsets.zero
|
let MTEdgeInsetsZero = UIEdgeInsets.zero
|
||||||
func MTGraphicsGetCurrentContext() -> CGContext? { UIGraphicsGetCurrentContext() }
|
func MTGraphicsGetCurrentContext() -> CGContext? { UIGraphicsGetCurrentContext() }
|
||||||
@@ -24,11 +24,11 @@ func MTGraphicsGetCurrentContext() -> CGContext? { UIGraphicsGetCurrentContext()
|
|||||||
|
|
||||||
import AppKit
|
import AppKit
|
||||||
|
|
||||||
typealias MTView = NSView
|
public typealias MTView = NSView
|
||||||
typealias MTColor = NSColor
|
public typealias MTColor = NSColor
|
||||||
typealias MTBezierPath = NSBezierPath
|
public typealias MTBezierPath = NSBezierPath
|
||||||
typealias MTEdgeInsets = NSEdgeInsets
|
public typealias MTEdgeInsets = NSEdgeInsets
|
||||||
typealias MTRect = NSRect
|
public typealias MTRect = NSRect
|
||||||
|
|
||||||
let MTEdgeInsetsZero = NSEdgeInsets.init(top: 0, left: 0, bottom: 0, right: 0)
|
let MTEdgeInsetsZero = NSEdgeInsets.init(top: 0, left: 0, bottom: 0, right: 0)
|
||||||
func MTGraphicsGetCurrentContext() -> CGContext? { NSGraphicsContext.current?.cgContext }
|
func MTGraphicsGetCurrentContext() -> CGContext? { NSGraphicsContext.current?.cgContext }
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ public enum MTTextAlignment : UInt {
|
|||||||
the `font` parameter.
|
the `font` parameter.
|
||||||
*/
|
*/
|
||||||
@IBDesignable
|
@IBDesignable
|
||||||
class MTMathUILabel : MTView {
|
public class MTMathUILabel : MTView {
|
||||||
|
|
||||||
/** The `MTMathList` to render. Setting this will remove any
|
/** The `MTMathList` to render. Setting this will remove any
|
||||||
`latex` that has already been set. If `latex` has been set, this will
|
`latex` that has already been set. If `latex` has been set, this will
|
||||||
@@ -70,7 +70,7 @@ class MTMathUILabel : MTView {
|
|||||||
`mathList` that is set.
|
`mathList` that is set.
|
||||||
@see error */
|
@see error */
|
||||||
@IBInspectable
|
@IBInspectable
|
||||||
var latex = "" {
|
public var latex = "" {
|
||||||
didSet {
|
didSet {
|
||||||
self.error = nil
|
self.error = nil
|
||||||
var error : NSError? = nil
|
var error : NSError? = nil
|
||||||
@@ -105,7 +105,7 @@ class MTMathUILabel : MTView {
|
|||||||
|
|
||||||
/** Convenience method to just set the size of the font without changing the fontface. */
|
/** Convenience method to just set the size of the font without changing the fontface. */
|
||||||
@IBInspectable
|
@IBInspectable
|
||||||
var fontSize = MTFontManager.fontManager.kDefaultFontSize {
|
public var fontSize = MTFontManager.fontManager.kDefaultFontSize {
|
||||||
didSet {
|
didSet {
|
||||||
self.font = font?.copy(withSize: fontSize)
|
self.font = font?.copy(withSize: fontSize)
|
||||||
}
|
}
|
||||||
@@ -113,7 +113,7 @@ class MTMathUILabel : MTView {
|
|||||||
|
|
||||||
/** This sets the text color of the rendered math formula. The default color is black. */
|
/** This sets the text color of the rendered math formula. The default color is black. */
|
||||||
@IBInspectable
|
@IBInspectable
|
||||||
var textColor:MTColor? = MTColor.black {
|
public var textColor:MTColor? = MTColor.black {
|
||||||
didSet {
|
didSet {
|
||||||
self.displayList?.textColor = textColor
|
self.displayList?.textColor = textColor
|
||||||
self.setNeedsDisplay()
|
self.setNeedsDisplay()
|
||||||
@@ -125,7 +125,7 @@ class MTMathUILabel : MTView {
|
|||||||
the border/background color. sizeThatFits: will have its returned size increased by these insets.
|
the border/background color. sizeThatFits: will have its returned size increased by these insets.
|
||||||
*/
|
*/
|
||||||
@IBInspectable
|
@IBInspectable
|
||||||
var contentInsets = MTEdgeInsetsZero {
|
public var contentInsets = MTEdgeInsetsZero {
|
||||||
didSet {
|
didSet {
|
||||||
self.invalidateIntrinsicContentSize()
|
self.invalidateIntrinsicContentSize()
|
||||||
self.setNeedsLayout()
|
self.setNeedsLayout()
|
||||||
@@ -185,7 +185,7 @@ class MTMathUILabel : MTView {
|
|||||||
self.addSubview(errorLabel!)
|
self.addSubview(errorLabel!)
|
||||||
}
|
}
|
||||||
|
|
||||||
override func draw(_ dirtyRect: MTRect) {
|
override public func draw(_ dirtyRect: MTRect) {
|
||||||
super.draw(dirtyRect)
|
super.draw(dirtyRect)
|
||||||
if self.mathList == nil { return }
|
if self.mathList == nil { return }
|
||||||
|
|
||||||
@@ -237,19 +237,19 @@ class MTMathUILabel : MTView {
|
|||||||
return size
|
return size
|
||||||
}
|
}
|
||||||
|
|
||||||
override var intrinsicContentSize: CGSize { _sizeThatFits(CGSizeZero) }
|
override public var intrinsicContentSize: CGSize { _sizeThatFits(CGSizeZero) }
|
||||||
|
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
override var isFlipped: Bool { false }
|
override public var isFlipped: Bool { false }
|
||||||
func setNeedsDisplay() { self.needsDisplay = true }
|
func setNeedsDisplay() { self.needsDisplay = true }
|
||||||
func setNeedsLayout() { self.needsLayout = true }
|
func setNeedsLayout() { self.needsLayout = true }
|
||||||
override func layout() {
|
override public func layout() {
|
||||||
self._layoutSubviews()
|
self._layoutSubviews()
|
||||||
super.layout()
|
super.layout()
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
override func layoutSubviews() { self._layoutSubviews() }
|
override public func layoutSubviews() { self._layoutSubviews() }
|
||||||
override func sizeThatFits(_ size: CGSize) -> CGSize { self._sizeThatFits(size) }
|
override public func sizeThatFits(_ size: CGSize) -> CGSize { self._sizeThatFits(size) }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user