-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: refactor configs and add zoom scale limitation settings #184
Conversation
split config into 3 config files put dial config into CropView Config add Global.swift
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks good. I did want to try this out but I'm getting:
Showing Recent Messages
Unable to load contents of file list: '/Target Support Files/Pods-MantisExample/Pods-MantisExample-frameworks-Debug-input-files.xcfilelist'
Unable to load contents of file list: '/Target Support Files/Pods-MantisExample/Pods-MantisExample-frameworks-Debug-output-files.xcfilelist'
Also it's not really clear to me which xworkspace
file I should open. Sorry for that, I'm coming originally from Android.
@@ -76,8 +75,8 @@ extension EmbeddedCropViewController: CropViewControllerDelegate { | |||
} | |||
|
|||
func cropViewControllerDidEndResize(_ cropViewController: CropViewController, original: UIImage, cropInfo: CropInfo) { | |||
let croppedImage = Mantis.crop(image: original, by: cropInfo) | |||
self.resolutionLabel.text = getResolution(image: croppedImage) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the Int(size.width) + 1
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's ceiling the value, right? If so should not we do this in the library itself? So that as a consumer you can just use size.width
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will update code to make it less confusing.
public var hotAreaUnit: CGFloat = 32 | ||
public var cropShapeType: CropShapeType = .rect | ||
public var cropVisualEffectType: CropVisualEffectType = .blurDark | ||
public var minimumZoomScale: CGFloat = 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is 1
really the lower bound or can we go even further down (e.g. 0.5), if so, I think we should document it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Initially only zoom in is allowed (otherwise the crop box will be bigger than the image), so I think it is reasonable to set minimumZoomScale to 1, although it might be changed later.
Co-authored-by: Niklas Baudy <niklas.baudy@vanniktech.de>
Co-authored-by: Niklas Baudy <niklas.baudy@vanniktech.de>
Co-authored-by: Niklas Baudy <niklas.baudy@vanniktech.de>
Co-authored-by: Niklas Baudy <niklas.baudy@vanniktech.de>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks juicy! Thanks ❤️
@@ -37,7 +37,7 @@ public enum PresetFixedRatioType { | |||
case canUseMultiplePresetFixedRatio(defaultRatio: Double = 0) | |||
} | |||
|
|||
public enum CropVisualEffectType { | |||
public enum CropMaskVisualEffectType { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the new name!
split config into 3 config files
put dial config into CropView Config
add Global.swift