mirror of
https://github.com/FossifyOrg/Gallery.git
synced 2024-11-26 22:47:59 +01:00
flip width and height if the image is rotated
This commit is contained in:
parent
900dbbff32
commit
e99451b2f0
1 changed files with 11 additions and 3 deletions
|
@ -76,13 +76,21 @@ class EditActivity : SimpleActivity(), CropImageView.OnCropImageCompleteListener
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun resizeImage() {
|
private fun resizeImage() {
|
||||||
val rect = crop_image_view.cropRect
|
ResizeDialog(this, getAreaSize()) {
|
||||||
val croppedSize = Point(rect.width(), rect.height())
|
|
||||||
ResizeDialog(this, croppedSize) {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
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) {
|
override fun onCropImageComplete(view: CropImageView, result: CropImageView.CropResult) {
|
||||||
if (result.error == null) {
|
if (result.error == null) {
|
||||||
if (uri.scheme == "file") {
|
if (uri.scheme == "file") {
|
||||||
|
|
Loading…
Reference in a new issue