use crate::model::table::Cell;
pub(super) fn closed_content_height_hu(cell: &Cell, padding: i32) -> Option<i32> {
let [paragraph] = cell.paragraphs.as_slice() else {
return None;
};
let [line] = paragraph.line_segs.as_slice() else {
return None;
};
(padding > 0
&& line.vertical_pos == 0
&& line.text_height > 0
&& (i64::from(line.line_height) - i64::from(cell.height)).abs() <= 1
&& (i64::from(line.text_height) + i64::from(padding) - i64::from(line.line_height)).abs()
<= 1)
.then_some(line.text_height)
}