Skip to content
Closed
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 Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ dioxus-cli-config = { version = "0.7.3" }
dioxus-core-macro = { version = "0.7.3" }

# Taffy + Parley + Fontations
taffy = { git = "https://github.com/DioxusLabs/taffy", rev = "8391c0903648448cf0a78d7983cb9b49b5f200a3", default-features = false, features = [
taffy = { git = "https://github.com/DioxusLabs/taffy", rev = "6e811a8b72a8dc00d4765a927632606d9a2208af", default-features = false, features = [
"std",
"flexbox",
"grid",
Expand Down
6 changes: 6 additions & 0 deletions packages/stylo_taffy/src/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ pub fn is_block(input: stylo::Display) -> bool {
)
}

#[inline]
pub fn is_flow_root(input: stylo::Display) -> bool {
matches!(input.inside(), stylo::DisplayInside::FlowRoot)
}

#[inline]
pub fn is_table(input: stylo::Display) -> bool {
matches!(input.inside(), stylo::DisplayInside::Table)
Expand Down Expand Up @@ -613,6 +618,7 @@ pub fn to_taffy_style(style: &stylo::ComputedValues) -> taffy::Style<Atom> {
box_sizing: self::box_sizing(style.clone_box_sizing()),
item_is_table: display.inside() == stylo::DisplayInside::Table,
item_is_replaced: false,
item_is_flow_root: self::is_flow_root(display),
position: self::position(style.clone_position()),
overflow: taffy::Point {
x: self::overflow(style.clone_overflow_x()),
Expand Down
5 changes: 5 additions & 0 deletions packages/stylo_taffy/src/wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ impl<T: Deref<Target = ComputedValues>> taffy::CoreStyle for TaffyStyloStyle<T>
convert::is_block(self.0.get_box().display)
}

#[inline]
fn is_flow_root(&self) -> bool {
convert::is_flow_root(self.0.get_box().display)
}

#[inline]
fn box_sizing(&self) -> taffy::BoxSizing {
convert::box_sizing(self.0.get_position().box_sizing)
Expand Down
Loading