Page-break penalties were calculated by taking the amount of spare space
authorben <ben@cda61777-01e9-0310-a592-d414129be87e>
Fri, 24 Sep 2004 17:56:58 +0000 (17:56 +0000)
committerben <ben@cda61777-01e9-0310-a592-d414129be87e>
Fri, 24 Sep 2004 17:56:58 +0000 (17:56 +0000)
on the page (in internal units) and squaring it.  This was fine except that
fixed penalties weren't scaled by the size of an internal unit, so the page-
breaking changed when the units were changed.  Rather than scaling all the
fixed penalties, scale the space into 1/4096 point units before squaring it.

git-svn-id: svn://svn.tartarus.org/sgt/halibut@4575 cda61777-01e9-0310-a592-d414129be87e

bk_paper.c

index cab3a11..c37d646 100644 (file)
@@ -1604,7 +1604,8 @@ static page_data *page_breaks(line_data *first, line_data *last,
                     */
                    if (m != last && m->next && !m->next->page_break)
                    {
-                       int x = this_height - minheight;
+                       int x = (this_height - minheight) / FUNITS_PER_PT *
+                           4096.0;
                        int xf;
 
                        xf = x & 0xFF;