Make sure that the first line of a paragraph is never by itself at the bottom of a page

This commit is contained in:
Devon Govett 2011-07-22 13:12:06 -04:00
parent bffd8d9878
commit 0d11ae8777

View File

@ -221,8 +221,10 @@ module.exports =
# we're no longer on the first line...
wrap.firstLine = false
# if we've reached the maximum height provided
if @y > maxY
# if we've reached the maximum height and make sure
# that the first line of a paragraph is never by itself
# at the bottom of a page
if @y > maxY or (wrap.lastLine and @y + @currentLineHeight(true) > maxY)
return unless @y >= @page.maxY()
# if we've reached the edge of the page,