Files
swiftui-math/Sources/SwiftMathRender/MathRender/MTConfig.swift
2023-01-16 08:41:15 -05:00

37 lines
838 B
Swift

//
// MTConfig.swift
// MathRenderSwift
//
// Created by Mike Griebling on 2023-01-01.
//
import Foundation
#if os(iOS)
import UIKit
public typealias MTView = UIView
public typealias MTColor = UIColor
public typealias MTBezierPath = UIBezierPath
public typealias MTLabel = UILabel
public typealias MTRect = CGRect
let MTEdgeInsetsZero = UIEdgeInsets.zero
func MTGraphicsGetCurrentContext() -> CGContext? { UIGraphicsGetCurrentContext() }
#else
import AppKit
public typealias MTView = NSView
public typealias MTColor = NSColor
public typealias MTBezierPath = NSBezierPath
public typealias MTEdgeInsets = NSEdgeInsets
public typealias MTRect = NSRect
let MTEdgeInsetsZero = NSEdgeInsets.init(top: 0, left: 0, bottom: 0, right: 0)
func MTGraphicsGetCurrentContext() -> CGContext? { NSGraphicsContext.current?.cgContext }
#endif