summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-01-21 00:52:45 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2025-02-18 04:50:08 +0100
commit51e44e036a5e2acf67caae4fc7265e6185f13d42 (patch)
treeb940c1af20f5c3ec010b64deb17d589b89366b10
parente594346544ea96858f6483685a36116e2f39bdde (diff)
downloadiced-51e44e036a5e2acf67caae4fc7265e6185f13d42.tar.gz
iced-51e44e036a5e2acf67caae4fc7265e6185f13d42.tar.bz2
iced-51e44e036a5e2acf67caae4fc7265e6185f13d42.zip
Add `bounds` argument to `Component::operate`
-rw-r--r--widget/src/lazy/component.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/widget/src/lazy/component.rs b/widget/src/lazy/component.rs
index c215de7a..0cfcc953 100644
--- a/widget/src/lazy/component.rs
+++ b/widget/src/lazy/component.rs
@@ -77,6 +77,7 @@ pub trait Component<Message, Theme = crate::Theme, Renderer = crate::Renderer> {
/// By default, it does nothing.
fn operate(
&self,
+ _bounds: Rectangle,
_state: &mut Self::State,
_operation: &mut dyn widget::Operation,
) {
@@ -191,11 +192,13 @@ where
fn rebuild_element_with_operation(
&self,
+ layout: Layout<'_>,
operation: &mut dyn widget::Operation,
) {
let heads = self.state.borrow_mut().take().unwrap().into_heads();
heads.component.operate(
+ layout.bounds(),
self.tree
.borrow_mut()
.borrow_mut()
@@ -382,7 +385,7 @@ where
renderer: &Renderer,
operation: &mut dyn widget::Operation,
) {
- self.rebuild_element_with_operation(operation);
+ self.rebuild_element_with_operation(layout, operation);
let tree = tree.state.downcast_mut::<Rc<RefCell<Option<Tree>>>>();
self.with_element(|element| {