pub fn block_geometry(
intrinsic: (u32, u32),
fit: MediaFit,
line_height_px: f32,
pane_width_px: f32,
) -> (u16, f32)Expand description
How much space a block should take, given what it is and where it goes.
Returns (rows, height_lh):
rowsโ display rows to reserve. Both peers agree on this, which is what keepsscroll(a row index) anchoring the same source line whichever renderer is running.height_lhโ the drawn height in line-heights, which the drawing peer spends throughRowWeights. Deliberately allowed to be fractional: a 3.4-line-height image reserves 4 rows and draws 3.4 of them. Snapping it to 4 is what ยง3 of the design rejected, because it makes the rendered size a function of the font size.
rows is ceil(height_lh) so the reservation never under-covers the
drawing โ an image must not paint over the line beneath it.