diff options
author | 2023-07-27 01:02:28 +0200 | |
---|---|---|
committer | 2023-07-27 01:04:18 +0200 | |
commit | e2ba7ece83f141c149659747977147392df008f4 (patch) | |
tree | 5fa04524d0ca95c6289c4d5962af7a97098ec811 /core/src/overlay | |
parent | e29754f32d03efc4b075e9b63cc554d128bc2ccf (diff) | |
download | iced-e2ba7ece83f141c149659747977147392df008f4.tar.gz iced-e2ba7ece83f141c149659747977147392df008f4.tar.bz2 iced-e2ba7ece83f141c149659747977147392df008f4.zip |
Introduce `visible_bounds` operation for `Container`
Diffstat (limited to 'core/src/overlay')
-rw-r--r-- | core/src/overlay/element.rs | 7 | ||||
-rw-r--r-- | core/src/overlay/group.rs | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/core/src/overlay/element.rs b/core/src/overlay/element.rs index c2134343..29b404b8 100644 --- a/core/src/overlay/element.rs +++ b/core/src/overlay/element.rs @@ -172,11 +172,12 @@ where fn container( &mut self, id: Option<&widget::Id>, + bounds: Rectangle, operate_on_children: &mut dyn FnMut( &mut dyn widget::Operation<T>, ), ) { - self.operation.container(id, &mut |operation| { + self.operation.container(id, bounds, &mut |operation| { operate_on_children(&mut MapOperation { operation }); }); } @@ -193,8 +194,10 @@ where &mut self, state: &mut dyn widget::operation::Scrollable, id: Option<&widget::Id>, + bounds: Rectangle, + translation: Vector, ) { - self.operation.scrollable(state, id); + self.operation.scrollable(state, id, bounds, translation); } fn text_input( diff --git a/core/src/overlay/group.rs b/core/src/overlay/group.rs index deffaad0..691686cd 100644 --- a/core/src/overlay/group.rs +++ b/core/src/overlay/group.rs @@ -138,7 +138,7 @@ where renderer: &Renderer, operation: &mut dyn widget::Operation<Message>, ) { - operation.container(None, &mut |operation| { + operation.container(None, layout.bounds(), &mut |operation| { self.children.iter_mut().zip(layout.children()).for_each( |(child, layout)| { child.operate(layout, renderer, operation); |