From 63a6d66b2505c3fecfe65b92ee77e40fb4cf34b9 Mon Sep 17 00:00:00 2001 From: Benedikt Betz Date: Fri, 20 Oct 2023 10:37:45 +0200 Subject: Adjust asset size, edit README --- Assets/demo.gif | Bin 34136725 -> 36085786 bytes README.md | 17 +++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/Assets/demo.gif b/Assets/demo.gif index ac9ac66..2aefce2 100644 Binary files a/Assets/demo.gif and b/Assets/demo.gif differ diff --git a/README.md b/README.md index 67a21ea..fc63dab 100644 --- a/README.md +++ b/README.md @@ -118,14 +118,27 @@ struct ExampleView: View { } ``` -You can also configure `SwiftyCropView` by passing a `SwiftyCropConfiguration`: +SwiftyCrop supports two different mask shapes for cropping: +- `circle` +- `square` + +This is only the shape of the mask the user will see when cropping the image. The resulting, cropped image will always be a square. + +You can also configure `SwiftyCropView` by passing a `SwiftyCropConfiguration`. A configuration has the following properties: + +| Property | Description | +| ----------- | ----------- | +| `maxMagnificationScale` | `CGFloat`: The maximum scale factor that the image can be magnified while cropping. Defaults to `4.0`. | +| `maskRadius` | `CGFloat`: The radius of the mask used for cropping. Defaults to `130`. A good way is to make it dependend on the screens size. | + +Create a configuration like this: ```swift let configuration = SwiftyCropConfiguration( maxMagnificationScale = 4.0, maskRadius: 130 ) ``` - +and use it like this: ```swift .fullScreenCover(isPresented: $showImageCropper) { if let selectedImage = selectedImage { -- cgit v1.2.3