https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
h

Hamba

11/28/2023, 6:15 PM
I have a strange issue with cpu usage - ive narrowed it down to this style function that im using on some elements with Modifier.then(panelStyle())
Copy code
fun panelStyle(
    top: Dp = 10.dp,
    bottom: Dp = 10.dp,
    start: Dp = 10.dp,
    end: Dp = 10.dp,
    backColor: Color = Color(0xFFEEEEEE),
    internalPadding: Dp = 10.dp
): Modifier {
    return Modifier
        .padding(start, top, end, bottom)
        .clip(RoundedCornerShape(5.dp))
        .background(backColor)
        .padding(internalPadding)
}
When i open my app, the process sits at 11-12% cpu usage (on a ryzen 5600x) until the user does something at which point it drops down to 0.1% usage or so as expected from an idling program (i didnt work out exactly what part of the user action "fixes" the cpu usage). if i comment out the last
.padding(internalPadding)
line, the issue stops. is this possibly some bug in compose multiplatform?
👀 1
3 Views