Report active native math alignment and output lists

This commit is contained in:
gloamxun committed 2026-11-21 06:26:49 +08:00
1 parent 3ed2c2cd54
commit d02777a1fc
12 files changed
+779 -199

No files matched your search

@@ -51,6 +51,24 @@ fn scale(size: i64, factor: i64) -> i64 {
}
impl PageInsertions {
pub(super) fn activity<'a>(
&'a self,
state: &'a State,
nodes: &'a [NativeVerticalNode],
) -> impl Iterator<Item = (u8, i64, Option<usize>)> + 'a {
self.classes.iter().map(move |(&class, entry)| {
let size = scale(entry.size, i64::from(state.count(class.into())));
let split = entry.split.then(|| {
nodes
.iter()
.take(entry.placement.last + 1)
.filter(|node| matches!(node, NativeVerticalNode::Insertion(n) if n.class == class))
.count()
});
(class, size, split)
})
}
pub fn record_front(
&mut self,
node: &NativeInsertion,