diff --git a/Cargo.toml b/Cargo.toml index 8e494b7b..08d7e02a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "morphorm" -version = "0.6.2" +version = "0.6.3" edition = "2021" author = "George Atkinson " license = "MIT" diff --git a/ecs/Cargo.toml b/ecs/Cargo.toml index b71ce8e4..c162e94e 100644 --- a/ecs/Cargo.toml +++ b/ecs/Cargo.toml @@ -6,7 +6,7 @@ description = "A mini ECS used for testing the morphorm crate." license = "MIT" [dependencies] -morphorm = {version = "0.6.2", path = "../"} +morphorm = {version = "0.6.3", path = "../"} femtovg = {version = "0.7.1", default-features = false} rand = "0.8.5" slotmap = "1.0.6" \ No newline at end of file diff --git a/src/layout.rs b/src/layout.rs index 64b39734..e05cdd84 100644 --- a/src/layout.rs +++ b/src/layout.rs @@ -208,9 +208,9 @@ where let mut node_children = node .children(tree) - .filter(|child| child.position_type(store).unwrap_or_default() == PositionType::ParentDirected) .filter(|child| child.visible(store)) .enumerate() + .filter(|(_, child)| child.position_type(store).unwrap_or_default() == PositionType::ParentDirected) .peekable(); // Compute space and size of non-flexible parent-directed children. @@ -353,9 +353,9 @@ where // Compute flexible space and size on the cross-axis for parent-directed children. for (index, child) in children .iter_mut() - .filter(|child| child.node.position_type(store).unwrap_or_default() == PositionType::ParentDirected) - .filter(|child| !child.node.cross(store, layout_type).is_auto()) .enumerate() + .filter(|(_, child)| child.node.position_type(store).unwrap_or_default() == PositionType::ParentDirected) + .filter(|(_, child)| !child.node.cross(store, layout_type).is_auto()) { let mut child_cross_before = child.node.cross_before(store, layout_type); let child_cross = child.node.cross(store, layout_type); @@ -570,7 +570,8 @@ where // Compute stretch cross_before and stretch cross_after for auto cross children. // TODO: I think this only needs to be done for parent-directed children... - for (index, child) in children.iter_mut().filter(|child| child.node.cross(store, layout_type).is_auto()).enumerate() + for (index, child) in + children.iter_mut().enumerate().filter(|(_, child)| child.node.cross(store, layout_type).is_auto()) { let mut child_cross_before = child.node.cross_before(store, layout_type); let mut child_cross_after = child.node.cross_after(store, layout_type); @@ -781,8 +782,8 @@ where // Compute flexible space and size on the cross-axis for self-directed nodes. for (index, child) in children .iter_mut() - .filter(|child| child.node.position_type(store).unwrap_or_default() == PositionType::SelfDirected) .enumerate() + .filter(|(_, child)| child.node.position_type(store).unwrap_or_default() == PositionType::SelfDirected) { let mut child_cross_before = child.node.cross_before(store, layout_type); let child_cross = child.node.cross(store, layout_type); @@ -932,8 +933,8 @@ where // Compute flexible space and size on the main-axis for self-directed nodes. for (index, child) in children .iter_mut() - .filter(|child| child.node.position_type(store).unwrap_or_default() == PositionType::SelfDirected) .enumerate() + .filter(|(_, child)| child.node.position_type(store).unwrap_or_default() == PositionType::SelfDirected) { let mut child_main_before = child.node.main_before(store, layout_type); let child_main = child.node.main(store, layout_type);