fn measure_cell_height(&self, cell: &DrawCell, width: isize) -> isize {
let margins = &cell.cell_style.margins;
let bb = Rect2::new(
- 0..width.saturating_sub(px_to_xr(margins[Axis2::X].len() as isize)),
+ 0..width.saturating_sub(margin(cell, Axis2::X)),
0..isize::MAX,
);
self.measure_cell(cell, bb).y() + margin(cell, Axis2::Y)
self
}
+ /// Returns this `Value` with the added `footnotes`.
pub fn with_footnotes<'a>(
mut self,
footnotes: impl IntoIterator<Item = &'a Arc<Footnote>>,
footnotes.sort_by_key(|f| f.index);
}
+ /// Returns this `Value` with the added `subscripts`.
pub fn with_subscripts<'a>(
mut self,
subscripts: impl IntoIterator<Item = impl Into<String>>,
self
}
+ /// Returns this `Value` with the added `subscript`.
pub fn with_subscript(mut self, subscript: impl Into<String>) -> Self {
self.add_subscript(subscript);
self
}
+ /// Adds `subscript` to this `Value`.
pub fn add_subscript(&mut self, subscript: impl Into<String>) {
self.styling_mut().subscripts.push(subscript.into());
}
}
}
+ /// Constructs a new text `ValueInner` from `s`, which should have been
+ /// provided by the user.
pub fn new_user_text(s: impl Into<String>) -> Self {
let s: String = s.into();
if !s.is_empty() {