Perhaps it would be a quite basic question there I go:
I’m implementing a custom graphic view with 2 possible cases:
1. Infinite width (and fixed height) in such case the width is taken from the number of elements of the graphic and the i just allow horizontal scrolling.
2. Fixed with and height where in this case I need to know the width and height of the component to properly fit the graphic in the canvas rect.
Can anyone help me out with the second point? (I’m just starting so there are many things yet that I don’t know exist)
Thanks!
z
Zach Klippenstein (he/him) [MOD]
10/12/2021, 2:18 AM
Not quite sure what you're asking, but the max constraints give you that information. If you have something like this:
Copy code
Canvas(Modifier.fillMaxSize()) {
// inside here you have access to the size
}
m
Marc
10/21/2021, 9:37 AM
omg, yes hahaha, this is exactly what i wanted thanks!