In the last few versions of Compose, pixels don’t have their own type. They’re just raw floats or ints, so you don’t need to use any converter functions.
d
dimsuz
08/23/2020, 10:43 AM
but in this case I have to convert from dp to float. Conversion is needed. Or do you mean I can do
1.dp.toPx()
in newer versions?
t
Timo Drick
08/23/2020, 11:24 AM
Which version of compose do you use?
This .toPx() converts to float or .toIntPx() to int.