mirror of
https://github.com/SimpleMobileTools/Simple-Gallery.git
synced 2025-01-10 12:22:36 +01:00
flip width and height if the image is rotated
This commit is contained in:
parent
900dbbff32
commit
e99451b2f0
@ -76,13 +76,21 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
||||
}
|
||||
|
||||
private fun resizeImage() {
|
||||
val rect = crop_image_view.cropRect
|
||||
val croppedSize = Point(rect.width(), rect.height())
|
||||
ResizeDialog(this, croppedSize) {
|
||||
ResizeDialog(this, getAreaSize()) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private fun getAreaSize(): Point {
|
||||
val rect = crop_image_view.cropRect
|
||||
val rotation = crop_image_view.rotatedDegrees
|
||||
return if (rotation == 0 || rotation == 180) {
|
||||
Point(rect.width(), rect.height())
|
||||
} else {
|
||||
Point(rect.height(), rect.width())
|
||||
}
|
||||
}
|
||||
|
||||
override fun onCropImageComplete(view: CropImageView, result: CropImageView.CropResult) {
|
||||
if (result.error == null) {
|
||||
if (uri.scheme == "file") {
|
||||
|
Loading…
Reference in New Issue
Block a user