Colton Idle
11/11/2023, 10:15 PMColton Idle
11/11/2023, 10:16 PMclass MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MyApplicationTheme {
Box(
modifier = Modifier.fillMaxSize(),
contentAlignment = Alignment.Center,
) {
Box(modifier = Modifier.size(200.dp)) { MyAnim() }
Box(modifier = Modifier.size(200.dp).offset(x = 150.dp)) { MyAnim() }
}
}
}
}
}
@Composable
internal fun MyAnim() {
Box(
modifier = Modifier
.fillMaxSize()
.clip(CircleShape)
.aspectRatio(1f)
) {
MyComposable()
Box(
modifier = Modifier
.fillMaxSize()
.background(Color.Red)
)
}
}
@Composable
internal fun MyComposable() {
Box(
modifier = Modifier
.fillMaxSize()
) {
Box(
modifier = Modifier
.fillMaxSize()
.background(Color.Green)
)
}
}
Colton Idle
11/11/2023, 10:22 PMephemient
11/11/2023, 10:33 PMColton Idle
11/11/2023, 11:36 PMromainguy
11/11/2023, 11:37 PMephemient
11/11/2023, 11:37 PMephemient
11/11/2023, 11:37 PMgraphicsLayer
would workromainguy
11/11/2023, 11:38 PMColton Idle
11/11/2023, 11:41 PMColton Idle
11/11/2023, 11:42 PMColton Idle
11/11/2023, 11:43 PMromainguy
11/11/2023, 11:43 PMromainguy
11/11/2023, 11:43 PMromainguy
11/11/2023, 11:43 PMephemient
11/11/2023, 11:44 PMColton Idle
11/11/2023, 11:44 PMromainguy
11/11/2023, 11:44 PMromainguy
11/11/2023, 11:45 PMephemient
11/11/2023, 11:45 PMColton Idle
11/11/2023, 11:45 PMephemient
11/11/2023, 11:46 PMromainguy
11/11/2023, 11:46 PMephemient
11/11/2023, 11:46 PMromainguy
11/11/2023, 11:46 PMephemient
11/11/2023, 11:46 PMColton Idle
11/11/2023, 11:46 PMYou could also use a graphics layer and instead of drawing a circle on top you could draw a rectangle with dstin or something. That should also fix it
Weird cuz I thought that's essentially what's happening here. The red is a rectangle and only the clipping is happening at the end. So I thought there wouldn't be any aliasing. If I cropped green circle. And then red circle. I would have expected this issue.
romainguy
11/11/2023, 11:47 PMephemient
11/11/2023, 11:47 PMromainguy
11/11/2023, 11:48 PMColton Idle
11/11/2023, 11:48 PMromainguy
11/11/2023, 11:48 PMromainguy
11/11/2023, 11:49 PMromainguy
11/11/2023, 11:49 PMromainguy
11/11/2023, 11:49 PMromainguy
11/11/2023, 11:50 PMromainguy
11/11/2023, 11:52 PMColton Idle
11/11/2023, 11:54 PMColton Idle
11/11/2023, 11:54 PMromainguy
11/11/2023, 11:54 PMromainguy
11/11/2023, 11:55 PMColton Idle
11/11/2023, 11:55 PMromainguy
11/11/2023, 11:55 PMromainguy
11/11/2023, 11:55 PMromainguy
11/11/2023, 11:56 PMColton Idle
11/12/2023, 12:01 AMColton Idle
11/12/2023, 3:23 AMromainguy
11/12/2023, 3:26 AMColton Idle
11/12/2023, 3:50 AMromainguy
11/12/2023, 3:50 AMColton Idle
11/12/2023, 3:51 AMColton Idle
11/12/2023, 4:05 AMromainguy
11/12/2023, 4:07 AMColton Idle
11/12/2023, 4:11 AMColton Idle
11/12/2023, 4:23 AMaj
03/07/2024, 6:33 PMColton Idle
03/07/2024, 7:05 PMaj
03/07/2024, 7:15 PMromainguy
03/07/2024, 7:23 PM