how can I scale an picture inside a Box After it h...
# compose
m
how can I scale an picture inside a Box After it has been scaled by the Image composable? This does work, but I have to put the alpha Modifier. Is this intentional (for optimization) or a bug?
Copy code
Box(modifier = Modifier.size(cardWidth, cardHeight)){
    Image(
        // ..
        contentScale = ContentScale.Crop,
        modifier = Modifier.alpha(0.99f).graphicsLayer {
            scaleX = someScale
            scaleY = someScale
        }
    )
}
without the alpha, the whole scaled image is painted, beyond the box size
e
also I'd probably choose to do the scaling inside a custom painter instead of involving a graphicsLayer, and then you'd also have control over the clipping
well I guess it depends. if you're changing scaling interactively then graphicsLayer makes sense
m
hmm, I don't need to scale it dynamically (not right now)
I will look into the other option