@@ -300,6 +300,7 @@ impl BaseDocument {
300300 ibox. height = 0.0 ;
301301 } else {
302302 let output = self . compute_child_layout ( NodeId :: from ( ibox. id ) , child_inputs) ;
303+ ibox. baseline = output. first_baselines . y ;
303304 ibox. width = ( margin. left + margin. right + output. size . width ) * scale;
304305 ibox. height = ( margin. top + margin. bottom + output. size . height ) * scale;
305306 }
@@ -537,7 +538,7 @@ impl BaseDocument {
537538 // dbg!(&layout.size);
538539 // dbg!(&layout.location);
539540
540- state. append_inline_box_to_line ( box_break_data. advance , 0.0 ) ;
541+ state. append_inline_box_to_line ( box_break_data. advance , 0.0 , 0.0 ) ;
541542
542543 // if float.is_floated() {
543544 // println!("INLINE FLOATED BOX ({}) {:?}", ibox.id, float);
@@ -662,6 +663,11 @@ impl BaseDocument {
662663 // println!("known_dimensions: w: {:?} h: {:?}", inputs.known_dimensions.width, inputs.known_dimensions.height);
663664 // println!("\n");
664665
666+ let first_baseline = inline_layout
667+ . layout
668+ . first_baseline ( )
669+ . map ( |baseline| baseline + content_box_inset. top ) ;
670+
665671 // Put layout back
666672 self . nodes [ node_id]
667673 . data
@@ -672,7 +678,10 @@ impl BaseDocument {
672678 LayoutOutput {
673679 size : final_size,
674680 content_size : measured_size + padding. sum_axes ( ) ,
675- first_baselines : Point :: NONE ,
681+ first_baselines : Point {
682+ x : None ,
683+ y : first_baseline,
684+ } ,
676685 top_margin : CollapsibleMarginSet :: ZERO ,
677686 bottom_margin : CollapsibleMarginSet :: ZERO ,
678687 margins_can_collapse_through : !has_styles_preventing_being_collapsed_through
0 commit comments