Hi ! As I need custom drawing for my `Composable` ...
# compose
l
Hi ! As I need custom drawing for my
Composable
, is there a way to get the component size based on its given
Modifier
? I mean, given
Copy code
@Composable
fun MyComposable(modifier: Modifier = Modifier){}
Is there a way to get the allocated width and height (inside
MyComposable
definition) ?
a
You already have the size available when using
Canvas
,
Modifier.drawBehind
,
Modifier.drawWithContent
, etc. Check DrawScope.
👍 1
🙏 1