mirror of
https://github.com/michaelrsweet/pdfio.git
synced 2024-12-25 21:08:21 +01:00
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:
parent
48e6597337
commit
9020e92928
@ -763,6 +763,9 @@ pdfio_obj_t *img =
|
||||
/*interpolate*/true);
|
||||
```
|
||||
|
||||
> Note: Currently `pdfioFileCreateImageObjFromFile` does not support 12 bit JPEG
|
||||
> files or PNG files with an alpha channel.
|
||||
|
||||
|
||||
### Page Dictionary Functions
|
||||
|
||||
|
@ -780,7 +780,7 @@ format_code(docdata_t *dd, // I - Document data
|
||||
|
||||
lineheight = SIZE_CODEBLOCK * LINE_HEIGHT;
|
||||
dd->y -= 2.0 * lineheight;
|
||||
if (dd->y < dd->art_box.y1)
|
||||
if ((dd->y - lineheight) < dd->art_box.y1)
|
||||
{
|
||||
new_page(dd);
|
||||
|
||||
@ -1397,7 +1397,7 @@ render_line(docdata_t *dd, // I - Document data
|
||||
}
|
||||
|
||||
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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user