Hi ! I'm trying to define a squared component. So ...
# compose
l
Hi ! I'm trying to define a squared component. So that the component's size is always a square based on the minimum of its {maxWidth, maxHeight} constraints, and keeping its original location in the parent composable. So I've tried to define a modifier called
clipAsMinimumSquare
, but in the preview it seems that the composable to which I'm calling this modifier is still a rectangle, whereas its content is a square. As you can see from the code, I'm calling
layout
on the
Modifier
, but it seems that I've not defined it well.
l
Thank you. I've tried
Modifier.aspectRation(1f)
and I'm also getting a square for the main component (ChessBoard). So I can safely remove my own
Modifier