Add display model
This commit is contained in:
17
Sources/SwiftUIMath/Internal/Display/DisplayNode.swift
Normal file
17
Sources/SwiftUIMath/Internal/Display/DisplayNode.swift
Normal file
@@ -0,0 +1,17 @@
|
||||
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
|
||||
|
||||
func bounds() -> CGRect {
|
||||
CGRect(x: position.x, y: position.y - descent, width: width, height: ascent + descent)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user