Measure container children without intermediate placement
This commit is contained in:
1 parent
c330ecec2b
commit
7601aa2a5d
6 files changed
+81
-38
No files matched your search
@@ -37,10 +37,7 @@ impl Widget for Span {
|
||||
// from the cursor, because a text has to wrap at the width
|
||||
// actually there.
|
||||
let room = axis.pair(Some(along(cursor, far)), None);
|
||||
let len = match painter.known_len(child, axis, region, room) {
|
||||
Some(len) => len,
|
||||
None => painter.widget_at(child, region, room).len(axis),
|
||||
};
|
||||
let len = painter.measure_len(child, axis, region, room);
|
||||
cursor.px += len.px + self.gap;
|
||||
cursor.rel += len.rel;
|
||||
lens.push(len);
|
||||
|
||||
Reference in new issue
Block a user