Post

At minimum, you have a screen coordinate space (which is almost never what you want to use), a window coordinate space, and a Compose root coordinate space. Each of those can be measured in dps or pixels, and sometimes it matters if those pixels are integers or floats.

0 reposts2 likes

And then every single node has its own local coordinate space, after layouts and padding and scrolling and translations are each applied. Keeping track of what coordinate system you want to be working in is tricky when you start having complicated interactions that move across boundaries.

I wonder if there'd be a way to add type-safety somehow that would make it better, without adding too much friction. Having Offset as a type is great, but it's also just as important to keep track of what you have an Offset _from_