Introduce visible_bounds operation for Container

This commit is contained in:
Héctor Ramón Jiménez 2023-07-27 01:02:28 +02:00
parent e29754f32d
commit e2ba7ece83
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
16 changed files with 201 additions and 25 deletions

View file

@ -254,10 +254,22 @@ where
) {
let state = tree.state.downcast_mut::<State>();
operation.scrollable(state, self.id.as_ref().map(|id| &id.0));
let bounds = layout.bounds();
let content_layout = layout.children().next().unwrap();
let content_bounds = content_layout.bounds();
let translation =
state.translation(self.direction, bounds, content_bounds);
operation.scrollable(
state,
self.id.as_ref().map(|id| &id.0),
bounds,
translation,
);
operation.container(
self.id.as_ref().map(|id| &id.0),
bounds,
&mut |operation| {
self.content.as_widget().operate(
&mut tree.children[0],