Integrate native repeat boxes and PDF bookmarks

This commit is contained in:
gloamxun committed 2026-11-19 16:06:28 +08:00
1 parent 5163fc9854
commit 38e4822370
33 files changed
+1208 -143

No files matched your search

@@ -41,7 +41,11 @@ pub(super) fn find_break(
depth = d;
None
}
Some(NativeVerticalNode::Glue(_) | NativeVerticalNode::NamedGlue(_, _)) => (i > 0
Some(
NativeVerticalNode::Glue(_)
| NativeVerticalNode::NamedGlue(_, _)
| NativeVerticalNode::Leaders(_),
) => (i > 0
&& matches!(
nodes[i - 1],
NativeVerticalNode::Box(_)
@@ -54,7 +58,11 @@ pub(super) fn find_break(
.then_some(0),
Some(NativeVerticalNode::Kern(_) | NativeVerticalNode::ImplicitKern(_)) => matches!(
nodes.get(i + 1),
Some(NativeVerticalNode::Glue(_) | NativeVerticalNode::NamedGlue(_, _))
Some(
NativeVerticalNode::Glue(_)
| NativeVerticalNode::NamedGlue(_, _)
| NativeVerticalNode::Leaders(_)
)
)
.then_some(0),
Some(NativeVerticalNode::Penalty(p)) => Some(*p),
@@ -98,7 +106,11 @@ pub(super) fn find_break(
}
}
match node {
Some(NativeVerticalNode::Glue(g) | NativeVerticalNode::NamedGlue(g, _)) => {
Some(
NativeVerticalNode::Glue(g)
| NativeVerticalNode::NamedGlue(g, _)
| NativeVerticalNode::Leaders(LeaderGlue { glue: g, .. }),
) => {
if g.shrink.order != 0 && g.shrink.amount != 0 {
return Err("infinite glue shrinkage found in native box being split".into());
}