Make sure we have room for at least two lines in a paragraph or code block at the bottom of the page.

This commit is contained in:
Michael R Sweet 2024-12-15 17:46:03 -05:00
parent 48e6597337
commit 9020e92928
No known key found for this signature in database
GPG Key ID: BE67C75EC81F3244
2 changed files with 5 additions and 2 deletions

View File

@ -763,6 +763,9 @@ pdfio_obj_t *img =
/*interpolate*/true); /*interpolate*/true);
``` ```
> Note: Currently `pdfioFileCreateImageObjFromFile` does not support 12 bit JPEG
> files or PNG files with an alpha channel.
### Page Dictionary Functions ### Page Dictionary Functions

View File

@ -780,7 +780,7 @@ format_code(docdata_t *dd, // I - Document data
lineheight = SIZE_CODEBLOCK * LINE_HEIGHT; lineheight = SIZE_CODEBLOCK * LINE_HEIGHT;
dd->y -= 2.0 * lineheight; dd->y -= 2.0 * lineheight;
if (dd->y < dd->art_box.y1) if ((dd->y - lineheight) < dd->art_box.y1)
{ {
new_page(dd); new_page(dd);
@ -1397,7 +1397,7 @@ render_line(docdata_t *dd, // I - Document data
} }
dd->y -= margin_top + lineheight; dd->y -= margin_top + lineheight;
if (dd->y < dd->art_box.y1) if ((dd->y - (margin_top > 0.0 ? lineheight : 0.0)) < dd->art_box.y1)
{ {
new_page(dd); new_page(dd);