Measure container children without intermediate placement

This commit is contained in:
iris-ai committed 2026-09-17 15:53:24 -04:00
1 parent c330ecec2b
commit 7601aa2a5d
6 files changed
+81 -38

No files matched your search

+1 -4
View File
@@ -17,10 +17,7 @@ impl Widget for Scroll {
let whole = UiRegion::FULL;
let own = painter.placement();
let answer_len =
match painter.known_len(&self.inner, self.axis, whole, [Some(own.x), Some(own.y)]) {
Some(len) => len,
None => painter.widget(&self.inner).size().axis(self.axis),
};
painter.measure_len(&self.inner, self.axis, whole, [Some(own.x), Some(own.y)]);
let content = answer_len.apply_leftover();
self.container_len = container_len;
self.content_len = content.to_px(container_len);
+1 -4
View File
@@ -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);