Skip to content

Commit cc0c227

Browse files
author
vidy
committed
Add some comments about the node split method
1 parent 0daa403 commit cc0c227

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

examples/text.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ fn main() {
1414
for line in run.lines {
1515
for word in line.words {
1616
println!("{}", word.text.as_str());
17-
for char in word.chars {
18-
println!("{:?}", char);
19-
}
17+
// for char in word.chars {
18+
// println!("{:?}", char);
19+
// }
2020
}
2121
}
2222
}

src/node.rs

+3
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,11 @@ fn split<E: Encoder>(boxes: &mut [(RectF, usize)], spans: &[TextSpan<E>], lines:
201201
}
202202

203203
let tag = match (y_gaps.is_empty(), x_gaps.is_empty()) {
204+
// N y gaps, whatever x_gap is, if cells are all lines, then it is a line
204205
(true, _) if cells.iter().all(|n| n.tag() <= NodeTag::Line) => NodeTag::Line,
206+
// N x gaps, whatever y_gap is, if cells are all lines, then it is a paragraph
205207
(_, true) if cells.iter().all(|n| n.tag() <= NodeTag::Line) => NodeTag::Paragraph,
208+
// Otherwise it is a complex node
206209
_ => NodeTag::Complex
207210
};
208211

0 commit comments

Comments
 (0)