Skip to content
Draft
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
80 changes: 53 additions & 27 deletions 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 @@ -100,7 +100,7 @@ taffy = { version = "=0.11.0-experimental-cache-fix.3", default-features = false
"calc",
"detailed_layout_info",
] }
parley = { version = "0.10", default-features = false, features = ["std"] }
parley = { git = "https://github.com/linebender/parley", rev="30f6ff1970e958498787fbfbf68a2eb013bee158", default-features = false, features = ["std"] }
skrifa = { version = "0.42", default-features = false, features = [
"std",
] } # Should match parley and vello versions
Expand Down
2 changes: 2 additions & 0 deletions packages/blitz-dom/src/layout/construct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -942,6 +942,7 @@ pub(crate) fn build_inline_layout_into(
kind: box_kind,
// Overridden by push_inline_box method
index: 0,
baseline: None,
// Width and height are set during layout
width: 0.0,
height: 0.0,
Expand Down Expand Up @@ -1022,6 +1023,7 @@ pub(crate) fn build_inline_layout_into(
kind: box_kind,
// Overridden by push_inline_box method
index: 0,
baseline: None,
// Width and height are set during layout
width: 0.0,
height: 0.0,
Expand Down
13 changes: 11 additions & 2 deletions packages/blitz-dom/src/layout/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,7 @@ impl BaseDocument {
ibox.height = 0.0;
} else {
let output = self.compute_child_layout(NodeId::from(ibox.id), child_inputs);
ibox.baseline = output.first_baselines.y;
ibox.width = (margin.left + margin.right + output.size.width) * scale;
ibox.height = (margin.top + margin.bottom + output.size.height) * scale;
}
Expand Down Expand Up @@ -537,7 +538,7 @@ impl BaseDocument {
// dbg!(&layout.size);
// dbg!(&layout.location);

state.append_inline_box_to_line(box_break_data.advance, 0.0);
state.append_inline_box_to_line(box_break_data.advance, 0.0, 0.0);

// if float.is_floated() {
// println!("INLINE FLOATED BOX ({}) {:?}", ibox.id, float);
Expand Down Expand Up @@ -662,6 +663,11 @@ impl BaseDocument {
// println!("known_dimensions: w: {:?} h: {:?}", inputs.known_dimensions.width, inputs.known_dimensions.height);
// println!("\n");

let first_baseline = inline_layout
.layout
.first_baseline()
.map(|baseline| baseline + content_box_inset.top);

// Put layout back
self.nodes[node_id]
.data
Expand All @@ -672,7 +678,10 @@ impl BaseDocument {
LayoutOutput {
size: final_size,
content_size: measured_size + padding.sum_axes(),
first_baselines: Point::NONE,
first_baselines: Point {
x: None,
y: first_baseline,
},
top_margin: CollapsibleMarginSet::ZERO,
bottom_margin: CollapsibleMarginSet::ZERO,
margins_can_collapse_through: !has_styles_preventing_being_collapsed_through
Expand Down
Loading