Hey guys, quick question. If I have text inside a ...
# compose
c
Hey guys, quick question. If I have text inside a column that's centered amd centered horizontally but im adding chars dynamically to the text how would I go about keeping the leading edge fixed but only expand the trailing edge of the text?
s
Offhand, I would use a
Layout
and remember the size of the initial text box and use that to determine the position to draw the text.
👍 1
c
Ah right, so I figured to add an amount of padding to the composable start which would mimick the composable being kept fixed at the leading edge while the content was expanding but i was eyeballing the amount of padding to add to the start and I was running into the issue that the amount of padding isn't a fixed amount each time it's dynamic based of the char that I'm dealing with so I'll try that suggestion of a moving window, keeping a ref of a prev and the size to be of the text and take the difference of the two and add it to the padding start, that should work in theory 😅 Thanks for the suggestion