File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -1303,17 +1303,25 @@ def _add_page_children(max_row=inf):
13031303 page_is_empty , absolute_boxes , fixed_boxes )[:3 ]
13041304 if new_child :
13051305 page_is_empty = False
1306- if child_resume_at or resume_row == y :
1307- # Child is broken.
1306+ broken_child = False
1307+ span = _get_span (child .style ['grid_row_start' ])
1308+ if child_resume_at :
1309+ broken_child = True
1310+ elif resume_row is not None and y + span >= resume_row + 1 :
1311+ broken_child = True
1312+ if broken_child :
1313+ # Child is broken, add row to resume_at.
13081314 if resume_at is None :
13091315 resume_at = {}
13101316 if y not in resume_at :
13111317 resume_at [y ] = {}
13121318 if child_resume_at :
1313- # There is some content left for next page.
1319+ # There is some content left for next page, save the cell’s resume_at .
13141320 resume_at [y ][i ] = child_resume_at
1315- elif resume_row == y :
1316- # Only display the bottom of an empty cell.
1321+ elif broken_child :
1322+ # Everything fits but the cell overflows. Only display the bottom of an
1323+ # empty cell on next page, set the cell’s resume_at after the cell’s
1324+ # last child.
13171325 assert isinstance (new_child , boxes .ParentBox )
13181326 previous_skip_child = max (child_skip_stack ) if child_skip_stack else 0
13191327 resume_at [y ][i ] = {previous_skip_child + len (new_child .children ): None }
You can’t perform that action at this time.
0 commit comments