Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SwiftDraw/Sources/CanvasNSView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
// 3. This notice may not be removed or altered from any source distribution.
//

#if canImport(AppKit)
#if canImport(AppKit) && !targetEnvironment(macCatalyst)
import AppKit
import SwiftUI

Expand Down
31 changes: 31 additions & 0 deletions SwiftDraw/Sources/SVG+UIGraphicsImageRendererContext.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
//
// SVG+UIGraphicsImageRendererContext.swift
// SwiftDraw
//
// Created by Daniel on 10/14/25.
//

#if canImport(UIKit)
public import CoreGraphics
public import UIKit

public extension UIGraphicsImageRendererContext {

func draw(_ svg: SVG, in rect: CGRect? = nil) {
self.cgContext.draw(svg, in: rect)
}

func draw(_ svg: SVG, in rect: CGRect, byTiling: Bool) {
self.cgContext.draw(svg, in: rect, byTiling: byTiling)
}

func draw(
_ svg: SVG,
in rect: CGRect,
capInsets: (top: CGFloat, left: CGFloat, bottom: CGFloat, right: CGFloat),
byTiling: Bool
) {
self.cgContext.draw(svg, in: rect, capInsets: capInsets, byTiling: byTiling)
}
}
#endif
Loading