summaryrefslogtreecommitdiff
path: root/bk_paper.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2004-07-17 15:47:22 +0000
committerSimon Tatham <anakin@pobox.com>2004-07-17 15:47:22 +0000
commit8aac8532019ac6cee701d48ceb35473280219a0e (patch)
treea0a6a0babe35a75f8019a8b18c819bd6286beae7 /bk_paper.c
parent521f7f3da745f08b34bbf37578f652107b2bb2ed (diff)
downloadhalibut-8aac8532019ac6cee701d48ceb35473280219a0e.zip
halibut-8aac8532019ac6cee701d48ceb35473280219a0e.tar.gz
halibut-8aac8532019ac6cee701d48ceb35473280219a0e.tar.bz2
halibut-8aac8532019ac6cee701d48ceb35473280219a0e.tar.xz
Division by zero (which criminally failed to give rise to any kind
of signal!) was causing massive misplacement of the single line of text on a one-line page in PS and PDF. [originally from svn r4330]
Diffstat (limited to 'bk_paper.c')
-rw-r--r--bk_paper.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/bk_paper.c b/bk_paper.c
index b38060f..a8479c7 100644
--- a/bk_paper.c
+++ b/bk_paper.c
@@ -1691,9 +1691,11 @@ static page_data *page_breaks(line_data *first, line_data *last,
text += l->line_height;
l->page = page;
- l->ypos = text + space + head +
- space * (float)page->first_line->vshortfall[n] /
- page->first_line->space[n];
+ l->ypos = text + space + head;
+ if (page->first_line->space[n]) {
+ l->ypos += space * (float)page->first_line->vshortfall[n] /
+ page->first_line->space[n];
+ }
if (l == page->last_line)
break;