Thread
#compose
    k

    Koneko Toujou

    1 year ago
    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

    romainguy

    1 year ago
    There's not a single thing that does that. In particular the graphics pipeline is heavily involved (libhwui and Skia)
    k

    Koneko Toujou

    1 year ago
    Hmm is there code that gets whatever Compose needs to draw into Skia for it to draw?
    r

    romainguy

    1 year ago
    It's just Canvas and its related APIs like RenderNode
    k

    Koneko Toujou

    1 year ago
    Hmm ok
    r

    romainguy

    1 year ago
    What are you looking to know/understand exactly?
    k

    Koneko Toujou

    1 year ago
    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

    romainguy

    1 year ago
    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

    Koneko Toujou

    1 year ago
    So how do I account for padding and custom positions and custom widths and heights?