chore: Bump taffy version to 0.4.3 (#11606)
Taffy 0.4 has been released 2 months ago. We've been using an older commit from their 0.4 development branch since November. Compared to the commit we were pinned to, the following relevant changes have been made: -563d5dcee7
-64f8aa0fb1
-70b35712a2
 Release Notes: - N/A
This commit is contained in:
parent
76535578e9
commit
3bd53d0441
3 changed files with 11 additions and 9 deletions
10
Cargo.lock
generated
10
Cargo.lock
generated
|
@ -4654,9 +4654,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "grid"
|
name = "grid"
|
||||||
version = "0.11.0"
|
version = "0.13.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "1df00eed8d1f0db937f6be10e46e8072b0671accb504cf0f959c5c52c679f5b9"
|
checksum = "d196ffc1627db18a531359249b2bf8416178d84b729f3cebeb278f285fb9b58c"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "group"
|
name = "group"
|
||||||
|
@ -9895,12 +9895,14 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "taffy"
|
name = "taffy"
|
||||||
version = "0.3.11"
|
version = "0.4.3"
|
||||||
source = "git+https://github.com/DioxusLabs/taffy?rev=1876f72bee5e376023eaa518aa7b8a34c769bd1b#1876f72bee5e376023eaa518aa7b8a34c769bd1b"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "7b2e140b328c6cb5e744bb2c65910b47df86b239afc793ee2c52262569cf9225"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"arrayvec",
|
"arrayvec",
|
||||||
"grid",
|
"grid",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
|
"serde",
|
||||||
"slotmap",
|
"slotmap",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ slotmap = "1.0.6"
|
||||||
smallvec.workspace = true
|
smallvec.workspace = true
|
||||||
smol.workspace = true
|
smol.workspace = true
|
||||||
sum_tree.workspace = true
|
sum_tree.workspace = true
|
||||||
taffy = { git = "https://github.com/DioxusLabs/taffy", rev = "1876f72bee5e376023eaa518aa7b8a34c769bd1b" }
|
taffy = "0.4.3"
|
||||||
thiserror.workspace = true
|
thiserror.workspace = true
|
||||||
time.workspace = true
|
time.workspace = true
|
||||||
util.workspace = true
|
util.workspace = true
|
||||||
|
|
|
@ -9,14 +9,14 @@ use taffy::{
|
||||||
geometry::{Point as TaffyPoint, Rect as TaffyRect, Size as TaffySize},
|
geometry::{Point as TaffyPoint, Rect as TaffyRect, Size as TaffySize},
|
||||||
style::AvailableSpace as TaffyAvailableSpace,
|
style::AvailableSpace as TaffyAvailableSpace,
|
||||||
tree::NodeId,
|
tree::NodeId,
|
||||||
Taffy,
|
TaffyTree, TraversePartialTree as _,
|
||||||
};
|
};
|
||||||
|
|
||||||
type NodeMeasureFn =
|
type NodeMeasureFn =
|
||||||
Box<dyn FnMut(Size<Option<Pixels>>, Size<AvailableSpace>, &mut WindowContext) -> Size<Pixels>>;
|
Box<dyn FnMut(Size<Option<Pixels>>, Size<AvailableSpace>, &mut WindowContext) -> Size<Pixels>>;
|
||||||
|
|
||||||
pub struct TaffyLayoutEngine {
|
pub struct TaffyLayoutEngine {
|
||||||
taffy: Taffy,
|
taffy: TaffyTree<()>,
|
||||||
styles: FxHashMap<LayoutId, Style>,
|
styles: FxHashMap<LayoutId, Style>,
|
||||||
children_to_parents: FxHashMap<LayoutId, LayoutId>,
|
children_to_parents: FxHashMap<LayoutId, LayoutId>,
|
||||||
absolute_layout_bounds: FxHashMap<LayoutId, Bounds<Pixels>>,
|
absolute_layout_bounds: FxHashMap<LayoutId, Bounds<Pixels>>,
|
||||||
|
@ -29,7 +29,7 @@ static EXPECT_MESSAGE: &str = "we should avoid taffy layout errors by constructi
|
||||||
impl TaffyLayoutEngine {
|
impl TaffyLayoutEngine {
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
TaffyLayoutEngine {
|
TaffyLayoutEngine {
|
||||||
taffy: Taffy::new(),
|
taffy: TaffyTree::new(),
|
||||||
styles: FxHashMap::default(),
|
styles: FxHashMap::default(),
|
||||||
children_to_parents: FxHashMap::default(),
|
children_to_parents: FxHashMap::default(),
|
||||||
absolute_layout_bounds: FxHashMap::default(),
|
absolute_layout_bounds: FxHashMap::default(),
|
||||||
|
@ -114,7 +114,7 @@ impl TaffyLayoutEngine {
|
||||||
fn max_depth(&self, depth: u32, parent: LayoutId) -> anyhow::Result<u32> {
|
fn max_depth(&self, depth: u32, parent: LayoutId) -> anyhow::Result<u32> {
|
||||||
println!(
|
println!(
|
||||||
"{parent:?} at depth {depth} has {} children",
|
"{parent:?} at depth {depth} has {} children",
|
||||||
self.taffy.child_count(parent.0)?
|
self.taffy.child_count(parent.0)
|
||||||
);
|
);
|
||||||
|
|
||||||
let mut max_child_depth = 0;
|
let mut max_child_depth = 0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue