Closed lucasmeneghin closed 7 months ago
Like same issue , I try to add shadow
application {
val windowState =
rememberDialogState(height = 250.dp)
Dialog(
onCloseRequest = ::exitApplication,
state = windowState,
undecorated = true,
transparent = true,
resizable = false
) {
App(
pageModifier = Modifier.fillMaxWidth()
.shadow(20.dp, RoundedCornerShape(5.dp)),
title = {
WindowDraggableArea {
PageTitle()
}
}
)
}
}
I can‘t get shadow, and must add padding to show shaodw.
Is there any follow-up on this issue?
The original issue is no longer reproducible 1.6.0-rc02
@lizhongyue248 Please file a new issue, and provide a complete, minimal reproducer (the code you posted is missing the definition of App
).
It is reproducible on a non-integer system scale. On macOs it usually isn't possible to set, so it is needed to check on Windows/Linux.
Steps to reproduce:
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.singleWindowApplication
fun main() = singleWindowApplication(undecorated = true) { Box(modifier = Modifier.fillMaxSize().border((1).dp, color = Color.Red)) }
3. resize. some sizes results in a white line on the right/bottom
<img width="513" alt="image" src="https://github.com/JetBrains/compose-multiplatform/assets/5963351/dbae5ed3-1ed2-4498-8055-7846996528fc">
(in `1.6.0-rc02` the hiding isn't reproducible, only the white line)
This happens, because the system resizes the window in pixels, but AWT reports the size in int points, and loses precision. The proper fix will be to read/subscribe to the size of the window via native code.
related issue: https://github.com/JetBrains/compose-multiplatform/issues/179 (slightly different because we had overlapping with system titlebar and window border)
Found the older issue: https://github.com/JetBrains/compose-multiplatform/issues/555. Let's keep only that issue.
Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.
If transparent = false, the lower border is there, but it is thiner.
transparent with height 251.dp
transparent = false with 251.dp
same with 252.dp
Its not specific to those values, 450 dp transparent will also not produce a lower border and etc