mirror of
https://github.com/laosb/CropImage.git
synced 2025-05-01 08:01:09 +00:00
Compare commits
No commits in common. "main" and "0.8.0" have entirely different histories.
4 changed files with 2 additions and 11 deletions
2
.github/FUNDING.yml
vendored
2
.github/FUNDING.yml
vendored
|
@ -1,2 +0,0 @@
|
||||||
github: [laosb]
|
|
||||||
buy_me_a_coffee: laosb
|
|
|
@ -233,7 +233,7 @@ public struct CropImageView<Controls: View, CutHole: View>: View {
|
||||||
var body: some View {
|
var body: some View {
|
||||||
VStack {
|
VStack {
|
||||||
CropImageView(
|
CropImageView(
|
||||||
image: .previewImage,
|
image: .init(contentsOf: URL(string: "file:///System/Library/Desktop%20Pictures/Hello%20Metallic%20Blue.heic")!)!,
|
||||||
targetSize: targetSize
|
targetSize: targetSize
|
||||||
) {
|
) {
|
||||||
result = $0
|
result = $0
|
||||||
|
|
|
@ -13,17 +13,10 @@ import AppKit
|
||||||
///
|
///
|
||||||
/// On macOS, it's `NSImage` and on iOS/visionOS it's `UIImage`.
|
/// On macOS, it's `NSImage` and on iOS/visionOS it's `UIImage`.
|
||||||
public typealias PlatformImage = NSImage
|
public typealias PlatformImage = NSImage
|
||||||
extension PlatformImage {
|
|
||||||
@MainActor static let previewImage: PlatformImage = .init(contentsOf: URL(string: "file:///System/Library/Desktop%20Pictures/Hello%20Metallic%20Blue.heic")!)!
|
|
||||||
}
|
|
||||||
#else
|
#else
|
||||||
import UIKit
|
import UIKit
|
||||||
/// The image object type, aliased to each platform.
|
/// The image object type, aliased to each platform.
|
||||||
///
|
///
|
||||||
/// On macOS, it's `NSImage` and on iOS/visionOS it's `UIImage`.
|
/// On macOS, it's `NSImage` and on iOS/visionOS it's `UIImage`.
|
||||||
public typealias PlatformImage = UIImage
|
public typealias PlatformImage = UIImage
|
||||||
extension PlatformImage {
|
|
||||||
// This doesn't really work, but at least passes build.
|
|
||||||
static let previewImage: PlatformImage = .init(contentsOfFile: "/System/Library/Desktop Pictures/Hello Metallic Blue.heic")!
|
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -202,7 +202,7 @@ struct UnderlyingImageView: View {
|
||||||
offset: $offset,
|
offset: $offset,
|
||||||
scale: $scale,
|
scale: $scale,
|
||||||
rotation: $rotation,
|
rotation: $rotation,
|
||||||
image: .previewImage,
|
image: .init(contentsOf: URL(string: "file:///System/Library/Desktop%20Pictures/Hello%20Metallic%20Blue.heic")!)!,
|
||||||
viewSize: .init(width: 200, height: 100),
|
viewSize: .init(width: 200, height: 100),
|
||||||
targetSize: .init(width: 100, height: 100),
|
targetSize: .init(width: 100, height: 100),
|
||||||
fulfillTargetFrame: true
|
fulfillTargetFrame: true
|
||||||
|
|
Loading…
Add table
Reference in a new issue