-
-
Notifications
You must be signed in to change notification settings - Fork 976
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
If onlySquare is enabled, execute fitImage on display. #777
base: master
Are you sure you want to change the base?
Conversation
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.
The same code needs to be added for setImage()
function as well.
With this fix, the selected image view can't be moved up when scrolling. Can you take a look? |
@keremcesme Thank you for your review. Videos in the library also used |
@ramboli1986 Did you run that in the sample app? I checked and it works fine in the sample app. |
Nvm, I can't repo it any more. Thanks for the fix. |
strongSelf.squaredZoomScale = strongSelf.calculateSquaredZoomScale() | ||
if YPConfig.library.onlySquare { | ||
strongSelf.fitImage(true) | ||
} |
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 think we can replace it with
strongSelf.fitImage(YPConfig.library.onlySquare || YPConfig.library.isSquareByDefault)
squaredZoomScale is calculated in fitImage()
#776
To fix above issue.
If
onlySquare
is enabled when displaying an Asset, callfitImage
to crop it to a square.You can see how it works in the sample apps in the
feature/demo
branch.https://github.com/hanawat/YPImagePicker/tree/feature/demo