Open inamiy opened 2 years ago
I guess minAspectRatio
-> minimumAspectRatio
Hey @inamiy! Long time no see! I hope you've been going well! 😁
Hmm, interesting! So the idea is to have an "aspect ratio" range that the crop box can change shape inside?
Yeah, I feel like the delegate would be too late for that, but maybe it's not so hard to change the layoutSubviews
logic to change how the crop box is allowed to resize to support this.
Do you have some examples of some input/output images you would like to see from this sort of feature?
Yes, it's about restricting the crop box size to not become too long on one side!
I don't have a clear image yet on how the UX will be like. It will be nicer if dev can customize error behavior when crop-box reaches to the error size, e.g. show HUD, have haptic feedback and auto-resizing, etc.
I think auto-resizing is the easiest start, as well as providing its delegate method so that dev can additionally present custom HUD for warning message.
Crop-box size error detection timing is also another thing to consider.
I think errors on touchesEnded
is more preferred than touchesMoved
for now, as current impl also has auto-cropbox-resizing animation on touchesEnded
after delay, and single-shot per gesture is probably easier to manage.
One another idea is to have a crop-box frame to have a 🟥 red color during touchesMoved
so that users will be aware of invalid size but doesn't need to see custom error messages until touchesEnded
.
Hi @TimOliver 👋
Is it possible to control the result image size to be within certain aspect-ratio range?
For example, suppose dev wants to have square-ish image (1:1) which can be vertically long at most by 9:16. In such case, if user controls grid to be vertically longer than 9:16, the grid automatically force-shrinks down to max 9:16.
I have taken a quick look at the code if delegate calls can be a good place to tweak the aspect ratio of the grid, but seemed it's not an easy fix.
It will be nice if there is a quick way of handling this kind of constrained aspect ratio, and also would be nicer if there will be such property, e.g.:
(P.S. Using
ClosedRange
is better, but probably not possible as aspect-ratio usesCGSize
and also needs to be interpretable in ObjC!)