Add bounds argument to Component::operate
This commit is contained in:
parent
e594346544
commit
51e44e036a
1 changed files with 4 additions and 1 deletions
|
|
@ -77,6 +77,7 @@ pub trait Component<Message, Theme = crate::Theme, Renderer = crate::Renderer> {
|
||||||
/// By default, it does nothing.
|
/// By default, it does nothing.
|
||||||
fn operate(
|
fn operate(
|
||||||
&self,
|
&self,
|
||||||
|
_bounds: Rectangle,
|
||||||
_state: &mut Self::State,
|
_state: &mut Self::State,
|
||||||
_operation: &mut dyn widget::Operation,
|
_operation: &mut dyn widget::Operation,
|
||||||
) {
|
) {
|
||||||
|
|
@ -191,11 +192,13 @@ where
|
||||||
|
|
||||||
fn rebuild_element_with_operation(
|
fn rebuild_element_with_operation(
|
||||||
&self,
|
&self,
|
||||||
|
layout: Layout<'_>,
|
||||||
operation: &mut dyn widget::Operation,
|
operation: &mut dyn widget::Operation,
|
||||||
) {
|
) {
|
||||||
let heads = self.state.borrow_mut().take().unwrap().into_heads();
|
let heads = self.state.borrow_mut().take().unwrap().into_heads();
|
||||||
|
|
||||||
heads.component.operate(
|
heads.component.operate(
|
||||||
|
layout.bounds(),
|
||||||
self.tree
|
self.tree
|
||||||
.borrow_mut()
|
.borrow_mut()
|
||||||
.borrow_mut()
|
.borrow_mut()
|
||||||
|
|
@ -382,7 +385,7 @@ where
|
||||||
renderer: &Renderer,
|
renderer: &Renderer,
|
||||||
operation: &mut dyn widget::Operation,
|
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>>>>();
|
let tree = tree.state.downcast_mut::<Rc<RefCell<Option<Tree>>>>();
|
||||||
self.with_element(|element| {
|
self.with_element(|element| {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue