From b7619d6e638522929ed3fafc515e018a330c00d1 Mon Sep 17 00:00:00 2001 From: Kaur Kuut Date: Tue, 14 Apr 2020 14:05:39 +0300 Subject: [PATCH] Mark layout/paint request in the children_changed method. (#839) --- druid/src/contexts.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/druid/src/contexts.rs b/druid/src/contexts.rs index d514d76178..3cc2795d7a 100644 --- a/druid/src/contexts.rs +++ b/druid/src/contexts.rs @@ -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. @@ -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. @@ -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.