-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wrong calculations using the new HazeState #51
Comments
Merged
Hmm. Can you share a sample where this isn't working? Screen.Recording.2023-12-10.at.16.10.30.mov |
I tried it in Compose Desktop and Compose Web, the parent that receives |
Here's and example: LazyColumn {
item {
Box(
modifier = Modifier
.fillMaxWidth()
.height(300.dp)
) {
Image(
painterResource("image.png"),
contentDescription = null,
contentScale = ContentScale.Crop,
modifier = Modifier
.fillMaxSize()
.haze(
state = hazeState,
backgroundColor = Color(0xFF646464),
tint = Color(0x4D646464),
blurRadius = 30.dp,
)
)
Box(
modifier = Modifier
.align(Alignment.BottomStart)
.hazeChild(
key = "box",
state = hazeState,
shape = RoundedCornerShape(10.dp)
)
.padding(all = 1.5f.spacing)
) {
Text(
text = "sample text",
)
}
}
}
item {
// Add some random items so you can have a scroll
}
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
The new APIs are great and more friendly, but there's an issue when part of the parent gets invisible (When the parent is inside a LazyColumn for example), the boundsInRoot() that is being used to make the position calculations is not the best option for this case because it's ignoring the invisible area of the composable, I'll change it with positionInRoot() which fixes the issue.
Screen.Recording.2023-12-09.at.10.24.23.AM.mov
The text was updated successfully, but these errors were encountered: