You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an user crops an image, then sometimes the crop action is reverted or modified.
Steps to reproduce - option 1:
Open the crop controller
Tap and drag the LEFT-TOP corner and release
-> the crop view returns to the original position
Screen.Recording.2021-04-21.at.16.31.42.mov
Steps to reproduce - option 2:
Open the crop controller
Tap and drag the TOP edge and release
Tap and drag the LEFT edge and release
-> the crop view is zoomed out
Screen.Recording.2021-04-21.at.16.33.17.mov
Notes
It is reproducible also when you move the left-bottom or the right-top corner/edge , but is is not reproducible when moving the right-bottom corner. Once you move the right-bottom corner, then it is not reproducible anymore even when moving other corners.
The problem is in the function ImageContainer.contains, which return false when is called from CropView.makeSureImageContainsCropOverlay in the function CropView.adjustUIForNewCrop
refBounds.contains(p2) returns false, because of the precision/tolerance which is used. Check the prints of values from the function
The contains functions works correctly when called from updateCropBoxFrame
Suggested solution 1
change the tolerance to 1 or 0.5 or so
it could be a parameter in the ImageContainer.contains function and it would be changed only when calling from CropView.adjustUIForNewCrop
Suggested solution 2
Do not call makeSureImageContainsCropOverlay in the function CropView.adjustUIForNewCrop every time
I did not find, how the cropOverlay would end up out of bounds of the image just by dragging the corners.
Maybe we can call makeSureImageContainsCropOverlay in adjustUIForNewCrop only when adjustUIForNewCrop is called after setting the fixed ratio or after rotating
The text was updated successfully, but these errors were encountered:
@plisiam Thanks for the report and suggestions!
I fixed it in a branch. Would you mind helping to check if it solve the issue by using the commit below? Thank you very much!
When an user crops an image, then sometimes the crop action is reverted or modified.
Steps to reproduce - option 1:
Screen.Recording.2021-04-21.at.16.31.42.mov
Steps to reproduce - option 2:
Screen.Recording.2021-04-21.at.16.33.17.mov
Notes
ImageContainer.contains
, which return false when is called fromCropView.makeSureImageContainsCropOverlay
in the functionCropView.adjustUIForNewCrop
refBounds.contains(p2)
returns false, because of the precision/tolerance which is used. Check the prints of values from the functioncontains
functions works correctly when called fromupdateCropBoxFrame
Suggested solution 1
ImageContainer.contains
function and it would be changed only when calling fromCropView.adjustUIForNewCrop
Suggested solution 2
makeSureImageContainsCropOverlay
in the functionCropView.adjustUIForNewCrop
every timemakeSureImageContainsCropOverlay
inadjustUIForNewCrop
only whenadjustUIForNewCrop
is called after setting the fixed ratio or after rotatingThe text was updated successfully, but these errors were encountered: