summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pcl/pcpage.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/pcl/pcpage.c b/pcl/pcpage.c
index d3b4625f0..9952d8d8f 100644
--- a/pcl/pcpage.c
+++ b/pcl/pcpage.c
@@ -318,7 +318,7 @@ new_page_size(pcl_state_t * pcs,
318 floatp width_pts = psize->width * 0.01; 318 floatp width_pts = psize->width * 0.01;
319 floatp height_pts = psize->height * 0.01; 319 floatp height_pts = psize->height * 0.01;
320 float page_size[2]; 320 float page_size[2];
321 static float old_page_size[2] = { 0, 0 }; 321 float old_page_size[2];
322 gs_state *pgs = pcs->pgs; 322 gs_state *pgs = pcs->pgs;
323 gs_matrix mat; 323 gs_matrix mat;
324 bool changed_page_size; 324 bool changed_page_size;
@@ -326,12 +326,8 @@ new_page_size(pcl_state_t * pcs,
326 page_size[0] = width_pts; 326 page_size[0] = width_pts;
327 page_size[1] = height_pts; 327 page_size[1] = height_pts;
328 328
329 old_page_size[0] = 329 old_page_size[0] = gs_currentdevice(pcs->pgs)->MediaSize[0];
330 (float)(pcs->xfm_state.paper_size ? pcs->xfm_state.paper_size-> 330 old_page_size[1] = gs_currentdevice(pcs->pgs)->MediaSize[1];
331 width : 0);
332 old_page_size[1] =
333 (float)(pcs->xfm_state.paper_size ? pcs->xfm_state.paper_size->
334 height : 0);
335 331
336 put_param1_float_array(pcs, "PageSize", page_size); 332 put_param1_float_array(pcs, "PageSize", page_size);
337 333
@@ -362,9 +358,8 @@ new_page_size(pcl_state_t * pcs,
362 reset_margins(pcs, for_passthrough); 358 reset_margins(pcs, for_passthrough);
363 359
364 /* check if update_xfm_state changed the page size */ 360 /* check if update_xfm_state changed the page size */
365 changed_page_size = !(old_page_size[0] == pcs->xfm_state.paper_size->width 361 changed_page_size = !((int)old_page_size[0] == pcs->xfm_state.paper_size->width/100 &&
366 && old_page_size[1] == 362 (int)old_page_size[1] == pcs->xfm_state.paper_size->height/100);
367 pcs->xfm_state.paper_size->height);
368 363
369 /* 364 /*
370 * make sure underlining is disabled (homing the cursor may cause 365 * make sure underlining is disabled (homing the cursor may cause
@@ -1180,7 +1175,9 @@ pcl_get_default_paper(pcl_state_t * pcs)
1180 PAPER_SIZES[i].psize.width = atol(pwidth) * 10L; 1175 PAPER_SIZES[i].psize.width = atol(pwidth) * 10L;
1181 PAPER_SIZES[i].psize.height = atol(plength) * 10L; 1176 PAPER_SIZES[i].psize.height = atol(plength) * 10L;
1182 } 1177 }
1183 /* just a guess, values copied from letter entry in table PAPER_SIZES */ 1178 /* just a guess, values copied from letter entry in
1179 table PAPER_SIZES. NB offsets should be 0 for
1180 RTL. */
1184 PAPER_SIZES[i].psize.offset_portrait = 75 * 24L; 1181 PAPER_SIZES[i].psize.offset_portrait = 75 * 24L;
1185 PAPER_SIZES[i].psize.offset_landscape = 60 * 24L; 1182 PAPER_SIZES[i].psize.offset_landscape = 60 * 24L;
1186 return &(PAPER_SIZES[i].psize); 1183 return &(PAPER_SIZES[i].psize);