mirror of
https://github.com/DioxusLabs/dioxus
synced 2024-11-11 15:07:08 +00:00
ensure all nodes have a intialized layout
This commit is contained in:
parent
84db875101
commit
e1120bb644
1 changed files with 6 additions and 2 deletions
|
@ -36,9 +36,11 @@ pub(crate) struct StretchLayout {
|
|||
impl ChildDepState for StretchLayout {
|
||||
type Ctx = Rc<RefCell<Stretch>>;
|
||||
type DepState = Self;
|
||||
// todo: update mask
|
||||
// use tag to force this to be called when a node is built
|
||||
const NODE_MASK: NodeMask =
|
||||
NodeMask::new_with_attrs(AttributeMask::Static(SORTED_LAYOUT_ATTRS)).with_text();
|
||||
NodeMask::new_with_attrs(AttributeMask::Static(SORTED_LAYOUT_ATTRS))
|
||||
.with_text()
|
||||
.with_tag();
|
||||
|
||||
/// Setup the layout
|
||||
fn reduce<'a>(
|
||||
|
@ -73,6 +75,7 @@ impl ChildDepState for StretchLayout {
|
|||
} else {
|
||||
self.node =
|
||||
PossiblyUninitalized::Initialized(stretch.new_node(style, &[]).unwrap());
|
||||
changed = true;
|
||||
}
|
||||
} else {
|
||||
// gather up all the styles from the attribute list
|
||||
|
@ -104,6 +107,7 @@ impl ChildDepState for StretchLayout {
|
|||
self.node = PossiblyUninitalized::Initialized(
|
||||
stretch.new_node(style, &child_layout).unwrap(),
|
||||
);
|
||||
changed = true;
|
||||
}
|
||||
}
|
||||
if self.style != style {
|
||||
|
|
Loading…
Reference in a new issue