Minor fixes
This commit is contained in:
parent
d619ce3a08
commit
1877ddf7e4
|
@ -96,8 +96,7 @@ private struct DynamicTypeRangeModifier: ViewModifier {
|
|||
@Environment(\.backportDynamicTypeSize) private var size
|
||||
|
||||
private var resolvedSize: Backport<Any>.DynamicTypeSize {
|
||||
print(range)
|
||||
return range.contains(size)
|
||||
range.contains(size)
|
||||
? size
|
||||
: max(range.lowerBound, min(range.upperBound, size))
|
||||
}
|
||||
|
|
|
@ -18,20 +18,20 @@ public extension Backport<Any> {
|
|||
|
||||
public extension Backport<Any>.ImageRenderer {
|
||||
var cgImage: CGImage? {
|
||||
#if os(macOS)
|
||||
#if os(macOS)
|
||||
nsImage?.cgImage(forProposedRect: nil, context: .current, hints: nil)
|
||||
#else
|
||||
#else
|
||||
uiImage?.cgImage
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#if os(macOS)
|
||||
#if os(macOS)
|
||||
|
||||
var nsImage: NSImage? {
|
||||
NSHostingController(rootView: content).view.snapshot
|
||||
}
|
||||
|
||||
#else
|
||||
#else
|
||||
|
||||
var uiImage: UIImage? {
|
||||
let controller = UIHostingController(rootView: content)
|
||||
|
@ -55,7 +55,7 @@ public extension Backport<Any>.ImageRenderer {
|
|||
return image
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#if os(iOS)
|
||||
|
|
Loading…
Reference in New Issue