use crate::model::paragraph::{ColumnBreakType, Paragraph};
pub(super) fn body_ladder_is_unpositioned(paragraphs: &[Paragraph]) -> bool {
if paragraphs.len() < 2
|| paragraphs
.iter()
.skip(1)
.any(|para| para.column_type != ColumnBreakType::None)
{
return false;
}
let mut has_cache = false;
for para in paragraphs {
for line in ¶.line_segs {
if line.vertical_pos != 0 || line.line_height <= 0 {
return false;
}
has_cache = true;
}
}
has_cache
}
pub(super) fn body_ladder_has_original_source(paragraphs: &[Paragraph]) -> bool {
paragraphs
.iter()
.flat_map(|para| ¶.line_segs)
.all(|line| line.tag & crate::model::paragraph::LineSeg::TAG_IMPLEMENTATION_PROPERTY == 0)
}
pub(super) fn retain_declared_equation_frames(paragraph: &mut Paragraph) {
for control in &mut paragraph.controls {
if let crate::model::control::Control::Equation(equation) = control {
crate::renderer::equation::declared_frame::retain_unpositioned_host_frame(equation);
}
}
}