Skip to content

Commit 3470a14

Browse files
committed
wip
1 parent bc6b631 commit 3470a14

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

src/Typeset/Page/make_pages.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ pager_rep::pages_make () {
209209
env->write (PAGE_THE_TOTAL, as_string (n));
210210
for (i= 0; i < n; i++)
211211
pages << pages_make_page (sk[i]);
212-
if (env->page_packet == 2 && N (pages) < 2)
212+
if (env->page_packet == 2 && (N (pages) & 1) == 1)
213213
pages << pages_make_page (pagelet (space (0)));
214214
}
215215

src/Typeset/Page/pager.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,15 +302,15 @@ pager_rep::make_pages () {
302302
int nr_pages= N (pages);
303303
int nx = max (1, min (env->page_packet, nr_pages));
304304
if (env->page_packet == 2) nx= max (1, env->page_packet);
305-
int d = env->page_offset % nx;
306-
int ny = ((nr_pages + nx - 1 + d) / nx);
305+
int d = env->page_offset % nx;
306+
int ny= ((nr_pages + nx - 1 + d) / nx);
307307

308-
SI pixel= env->pixel;
309-
SI vgap = 0;
308+
SI pixel= env->pixel;
309+
SI vgap = 0;
310310
if (env->get_string (PAGE_BORDER) == "none") {
311311
vgap= 2 * pixel;
312312
}
313-
array<box> pg = pages;
313+
array<box> pg= pages;
314314
if (env->get_string (PAGE_MEDIUM) == "paper")
315315
for (int i= 0; i < nx; i++)
316316
for (int j= 0; j < ny; j++) {
@@ -357,7 +357,8 @@ pager_rep::make_pages () {
357357
yy[j]= yy[j - 1];
358358
for (int i= 0; i < nx; i++) {
359359
int p= j * nx + i - d;
360-
if (p >= 0 && p < nr_pages) yy[j]= min (yy[j - 1] - pg[p]->h () - vgap, yy[j]);
360+
if (p >= 0 && p < nr_pages)
361+
yy[j]= min (yy[j - 1] - pg[p]->h () - vgap, yy[j]);
361362
}
362363
}
363364

0 commit comments

Comments
 (0)