Skip to content

Commit

Permalink
Mark layout/paint request in the children_changed method. (#839)
Browse files Browse the repository at this point in the history
  • Loading branch information
xStrom authored Apr 14, 2020
1 parent bf0cbbf commit b7619d6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions druid/src/contexts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ impl<'a> EventCtx<'a> {
/// Widgets must call this method after adding a new child.
pub fn children_changed(&mut self) {
self.base_state.children_changed = true;
self.base_state.needs_layout = true;
self.base_state.needs_inval = true;
}

/// Get an object which can create text layouts.
Expand Down Expand Up @@ -451,6 +453,8 @@ impl<'a> LifeCycleCtx<'a> {
/// Widgets must call this method after adding a new child.
pub fn children_changed(&mut self) {
self.base_state.children_changed = true;
self.base_state.needs_layout = true;
self.base_state.needs_inval = true;
}

/// Request an animation frame.
Expand Down Expand Up @@ -504,6 +508,8 @@ impl<'a> UpdateCtx<'a> {
/// Widgets must call this method after adding a new child.
pub fn children_changed(&mut self) {
self.base_state.children_changed = true;
self.base_state.needs_layout = true;
self.base_state.needs_inval = true;
}

/// Get an object which can create text layouts.
Expand Down

0 comments on commit b7619d6

Please sign in to comment.