From e9e4e2876070fc7ec8b90579eac765c33f2d37b6 Mon Sep 17 00:00:00 2001 From: MM20 <15646950+MM2-0@users.noreply.github.com> Date: Wed, 24 Aug 2022 16:45:13 +0200 Subject: [PATCH] Duh --- .../main/java/de/mm20/launcher2/ui/component/LauncherCard.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ui/src/main/java/de/mm20/launcher2/ui/component/LauncherCard.kt b/ui/src/main/java/de/mm20/launcher2/ui/component/LauncherCard.kt index 5020f5c36..ed70ab37d 100644 --- a/ui/src/main/java/de/mm20/launcher2/ui/component/LauncherCard.kt +++ b/ui/src/main/java/de/mm20/launcher2/ui/component/LauncherCard.kt @@ -85,7 +85,7 @@ private fun CardMiddlePiece( val absoluteElevation = LocalAbsoluteTonalElevation.current + elevation Box( modifier = modifier - .shadow(elevation, RectangleShape, true) + .shadow(if (backgroundOpacity < 1f) 0.dp else elevation, RectangleShape, true) .background( if (backgroundOpacity == 1f) { MaterialTheme.colorScheme.surfaceColorAtElevation(absoluteElevation) @@ -149,7 +149,7 @@ private fun CardEndPiece( val absoluteElevation = LocalAbsoluteTonalElevation.current + elevation Box( modifier = modifier - .shadow(elevation, shape, true) + .shadow(if (backgroundOpacity < 1f) 0.dp else elevation, shape, true) .background( if (backgroundOpacity == 1f) { MaterialTheme.colorScheme.surfaceColorAtElevation(absoluteElevation) @@ -170,6 +170,7 @@ private fun CardEndPiece( Density(density, fontScale) ) onDrawBehind { + if (borderWidth == 0.dp) return@onDrawBehind withTransform({ translate(0f, if (isBottom) -border else 0f) }) {