( nodes: RawSnapshotNode[], scrollNode: RawSnapshotNode, )
| 215 | } |
| 216 | |
| 217 | function collectVisibleFlowBlocks( |
| 218 | nodes: RawSnapshotNode[], |
| 219 | scrollNode: RawSnapshotNode, |
| 220 | ): FlowBlock[] { |
| 221 | const contentRoot = unwrapScrollableContentRoot(nodes, scrollNode); |
| 222 | const children = nodes |
| 223 | .filter((node) => node.parentIndex === contentRoot.index && node.rect) |
| 224 | .map((node) => node.rect as Rect) |
| 225 | .filter((rect) => hasPositiveVerticalExtent(rect)) |
| 226 | .sort((left, right) => left.y - right.y); |
| 227 | |
| 228 | return children.map((rect) => toFlowBlock(rect, scrollNode.rect as Rect)); |
| 229 | } |
| 230 | |
| 231 | function unwrapScrollableContentRoot( |
| 232 | nodes: RawSnapshotNode[], |
no test coverage detected
searching dependent graphs…