as there are no dumb questions, what you prefer in...
# android
h
as there are no dumb questions, what you prefer in Canvas in jetpack compose : dp.toPx() or f ; eg:
Copy code
Offset(150.dp.toPx(), 150.dp.toPx())
or
Copy code
Offset(150f, 150f)
i like to use the former one as we have the real sense of how much lets say 100dp is.
d
Well those are different values entirely, but yes it’s almost always better to start with dp and then convert to pixels so you get a consistent result across densities
👍 4
☝️ 2