constrained(Constraints::tight(Vec2::splat(100.0)), || {
row(|| {
text("Lorem ipsum dolor sit amet blah blah blah I just want some long text here");
});
});
In this snippet, the text bleeds outside of the constrained area because List throws away the main axis constraints when laying out non-flex objects.
A workaround is to wrap the objects that need to be constrained in expanded or flexible with a non-zero flex factor:
constrained(Constraints::tight(Vec2::splat(100.0)), || {
row(|| {
expanded(|| {
text("Lorem ipsum dolor sit amet blah blah blah I just want some long text here");
});
// OR
flexible(1.0, || {
text("Lorem ipsum dolor sit amet blah blah blah I just want some long text here");
});
});
});
In this snippet, the text bleeds outside of the constrained area because
List
throws away the main axis constraints when laying out non-flex objects.A workaround is to wrap the objects that need to be constrained in
expanded
orflexible
with a non-zero flex factor: