From fceb5596611844433b833ed4dcd0102e386ba84c Mon Sep 17 00:00:00 2001 From: Abdelilah El Aissaoui Date: Mon, 17 Oct 2022 19:07:02 +0200 Subject: [PATCH] Added fixed size to image diff --- .../kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt b/src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt index 9f0cd3a..fcb136b 100644 --- a/src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt +++ b/src/main/kotlin/com/jetpackduba/gitnuro/ui/diff/Diff.kt @@ -280,7 +280,17 @@ private fun StaticImage(tempImagePath: String) { Image( bitmap = image ?: ImageBitmap.Blank, contentDescription = null, - modifier = Modifier.fillMaxSize() + modifier = Modifier + .run { + val safeImage = image + if(safeImage == null) + fillMaxSize() + else { + width(safeImage.width.dp) + .height(safeImage.height.dp) + + } + } .handMouseClickable { openFileWithExternalApp(tempImagePath) }