Files
swiftui-math/Sources/SwiftUIMath/Internal/Model/Atoms/Style.swift
Guille Gonzalez e66eeb4564 Refactor model
2026-01-02 15:24:11 +01:00

42 lines
701 B
Swift

import Foundation
extension Math {
final class Style: Atom {
enum Level: Int {
case display
case text
case script
case scriptOfScript
var isScript: Bool {
switch self {
case .script, .scriptOfScript:
return true
default:
return false
}
}
var isNotScript: Bool {
!isScript
}
func next() -> Level {
Level(rawValue: rawValue + 1) ?? .display
}
}
var level: Level
init(_ style: Style) {
self.level = style.level
super.init(style)
}
init(level: Level = .display) {
self.level = level
super.init(type: .style)
}
}
}