Hold the full painted backdrop until incoming hero art is ready

This commit is contained in:
justinzeus 2026-11-07 16:22:09 +01:00
parent 60b0c307aa
commit 9988a193de
4 changed files with 24 additions and 9 deletions

View file

@ -78,7 +78,7 @@ fun <T> HeroArtCrossfade(identity: Any, target: T, height: Dp, modifier: Modifie
layers.forEach { if (it !== selected) it.outgoing = true }
}
Box(modifier) {
layers.forEachIndexed { index, layer -> key(layer) {
layers.forEach { layer -> key(layer) {
SideEffect { if (layer.identity == identity) layer.target = target }
LaunchedEffect(layer.outgoing, reduced) {
if (layer.outgoing) {
@ -86,7 +86,7 @@ fun <T> HeroArtCrossfade(identity: Any, target: T, height: Dp, modifier: Modifie
layers.remove(layer)
}
}
val outgoing = index != 0
val outgoing = layer.outgoing
val onReady = remember(layer) { { layer.ready = true } }
val bounds = if (outgoing) Modifier.requiredSize(WolfskinTokens.Shell.stageWidth, height) else Modifier
Box(bounds.graphicsLayer { alpha = layer.alpha.value; clip = outgoing }