summaryrefslogtreecommitdiffstats
path: root/core/src/element.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2023-07-27 18:48:06 +0200
committerLibravatar GitHub <noreply@github.com>2023-07-27 18:48:06 +0200
commit18f1ab551be6fe9a603eb07dceddf231c01b5c7f (patch)
treea4fd30a4252c3a1469a618ac4754ee8a6d81a518 /core/src/element.rs
parente4b75ec9c76402dda7c6b6631918da240bb1c7ed (diff)
parentcbb5fcc8829e6fbe60f97cad8597c86ffd4f5b1a (diff)
downloadiced-18f1ab551be6fe9a603eb07dceddf231c01b5c7f.tar.gz
iced-18f1ab551be6fe9a603eb07dceddf231c01b5c7f.tar.bz2
iced-18f1ab551be6fe9a603eb07dceddf231c01b5c7f.zip
Merge pull request #1971 from iced-rs/visible-bounds-operation
`visible_bounds` operation for `Container`
Diffstat (limited to 'core/src/element.rs')
-rw-r--r--core/src/element.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/core/src/element.rs b/core/src/element.rs
index b9b76247..d2c6358b 100644
--- a/core/src/element.rs
+++ b/core/src/element.rs
@@ -5,7 +5,9 @@ use crate::overlay;
use crate::renderer;
use crate::widget;
use crate::widget::tree::{self, Tree};
-use crate::{Clipboard, Color, Layout, Length, Rectangle, Shell, Widget};
+use crate::{
+ Clipboard, Color, Layout, Length, Rectangle, Shell, Vector, Widget,
+};
use std::any::Any;
use std::borrow::Borrow;
@@ -325,11 +327,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 });
});
}
@@ -346,8 +349,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(