21 lines
516 B
Swift
21 lines
516 B
Swift
import CoreGraphics
|
|
import Foundation
|
|
|
|
extension Math {
|
|
class DisplayNode {
|
|
var ascent: CGFloat = 0
|
|
var descent: CGFloat = 0
|
|
var width: CGFloat = 0
|
|
var position: CGPoint = .zero
|
|
var range: NSRange = NSRange(location: 0, length: 0)
|
|
var hasScript: Bool = false
|
|
var textColor: CGColor?
|
|
var localTextColor: CGColor?
|
|
var localBackgroundColor: CGColor?
|
|
|
|
var bounds: CGRect {
|
|
CGRect(x: position.x, y: position.y - descent, width: width, height: ascent + descent)
|
|
}
|
|
}
|
|
}
|