Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api/layout/v1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ impl TryFrom<layout::v1::LayoutNode> for crate::layout::tree::LayoutNode {
top: taffy::LengthPercentageAuto::length(gaps.top),
bottom: taffy::LengthPercentageAuto::length(gaps.bottom),
})
.unwrap_or(taffy::Rect::length(0.0)),
.unwrap_or(taffy::Rect::length(0.0_f32)),
..Default::default()
};

Expand Down
2 changes: 1 addition & 1 deletion src/layout/tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ impl LayoutTree {
if children.is_empty() {
let mut new_node_style = tree.style(node).unwrap().clone();
let prev_margin = new_node_style.margin;
new_node_style.margin = taffy::Rect::length(0.0);
new_node_style.margin = taffy::Rect::length(0.0_f32);
tree.set_style(node, new_node_style).unwrap();

let leaf_child = tree
Expand Down
4 changes: 1 addition & 3 deletions src/util/treediff/zs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,16 +179,14 @@ impl<'a, T> ZsTree<'a, T> {
kr: Vec::new(),
};

let mut idx = 1;
let mut tmp_data = HashMap::new();
for n in tree.traverse_post_order() {
for (idx, n) in (1..).zip(tree.traverse_post_order()) {
tmp_data.insert(n, idx);
this.set_i_tree(idx, n);
this.set_lld(idx, *tmp_data.get(&get_first_leaf(n)).unwrap());
if n.children().next().is_none() {
this.leaf_count += 1;
}
idx += 1;
}

this.set_keyroots();
Expand Down
Loading