diff --git a/app/src/main/kotlin/de/markusfisch/android/binaryeye/graphics/BitmapEditor.kt b/app/src/main/kotlin/de/markusfisch/android/binaryeye/graphics/BitmapEditor.kt index 71fee2e9..8b17a688 100644 --- a/app/src/main/kotlin/de/markusfisch/android/binaryeye/graphics/BitmapEditor.kt +++ b/app/src/main/kotlin/de/markusfisch/android/binaryeye/graphics/BitmapEditor.kt @@ -59,8 +59,8 @@ fun crop(bitmap: Bitmap, rect: RectF, rotation: Float) = try { erected, x, y, - min(w - x, (rect.width() * w).roundToInt()), - min(h - y, (rect.height() * h).roundToInt()) + min(w - x, (rect.right * w).roundToInt() - x), + min(h - y, (rect.bottom * h).roundToInt() - y) ) } catch (e: OutOfMemoryError) { null