Where can I find the source code for how compose d...
# compose
k
Where can I find the source code for how compose draws its contents to the screen? Specifically the stuff that deals with converting padding/spacing, relative locations and so on, into absolute placement positions for graphics api to render to within the region specified
r
There's not a single thing that does that. In particular the graphics pipeline is heavily involved (libhwui and Skia)
k
Hmm is there code that gets whatever Compose needs to draw into Skia for it to draw?
r
It's just Canvas and its related APIs like RenderNode
k
Hmm ok
r
What are you looking to know/understand exactly?
k
I'm trying to understand how to correctly compute relative and absolute positions with account for margins/padding/position for a hierarchy in relation to parent view and current view
As so far I have position in terms of x,y offsets working But custom width and height, as well as padding, currently breaks my computation of relative and absolute position
This is all just geometry calculations that I need to figure out how to correctly do, as I don't need to do any graphical drawing specifically, just calculate rectangular boundaries and hitboxes and drawing positions and such
r
It's fairly simple it's pretty much accumulating the left and top position of children while going down the hierarchy, adding up the padding while doing so
k
So how do I account for padding and custom positions and custom widths and heights?