Skip to content

Commit

Permalink
Fix orphans check
Browse files Browse the repository at this point in the history
This effectively forbids line breaks before the first line.

Based on work in dompdf#1356
Fixes dompdf#1617

Co-authored-by: David Sickmiller <david@sickmiller.com>
  • Loading branch information
Mellthas and davidsickmiller committed Aug 27, 2021
1 parent dd09636 commit 45cef1b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/FrameDecorator/Page.php
Expand Up @@ -363,7 +363,8 @@ protected function _page_break_allowed(Frame $frame)

// Rule C
$block_parent = $frame->find_block_parent();
if (count($block_parent->get_line_boxes()) < $frame->get_style()->orphans) {
$current_line = count($block_parent->get_line_boxes());
if ($current_line <= $frame->get_style()->orphans) {
Helpers::dompdf_debug("page-break", "orphans");

return false;
Expand Down

0 comments on commit 45cef1b

Please sign in to comment.