]> mj.ucw.cz Git - paperjam.git/blobdiff - cmds.cc
page->bbox renamed to page->image_box
[paperjam.git] / cmds.cc
diff --git a/cmds.cc b/cmds.cc
index a39fe6eb15eb6e3d9d7b5272ef28c5afe296f7ef..262ad365feaffeb3f7483d8a2ea495e7d5bb2a9e 100644 (file)
--- a/cmds.cc
+++ b/cmds.cc
@@ -46,8 +46,8 @@ xform_page::xform_page(page *p, pdf_matrix xf)
   width = media.width();
   height = media.height();
 
-  bbox = p->bbox;
-  bbox.transform(xf);
+  image_box = p->image_box;
+  image_box.transform(xf);
 }
 
 void xform_page::render(out_context *out, pdf_matrix parent_xform)
@@ -550,7 +550,7 @@ void draw_bbox_page::render(out_context *out, pdf_matrix xform)
      "q " +
      xform.to_string() + " cm " +
      "0 1 0 RG " +
-     bbox.to_rect() + " re S " +
+     image_box.to_rect() + " re S " +
      "Q ";
 }
 
@@ -583,14 +583,14 @@ public:
            {
              width = p->width;
              height = p->height;
-             bbox = p->bbox;
+             image_box = p->image_box;
              first = false;
            }
          else
            {
              if (!is_equal(width, p->width) || !is_equal(height, p->height))
                die("All pages participating in a merge must have the same dimensions");
-             bbox.join(p->bbox);
+             image_box.join(p->image_box);
            }
        }
     }
@@ -619,7 +619,7 @@ public:
   page *process_page(page *p) override
     {
       BBox paper_box = BBox(paper.w, paper.h);
-      pdf_matrix xf = pos.place(p->bbox, paper_box);
+      pdf_matrix xf = pos.place(p->image_box, paper_box);
       page *q = new xform_page(p, xf);
       q->width = paper.w;
       q->height = paper.h;
@@ -677,7 +677,7 @@ public:
       if (!is_zero(paper.w) && !is_zero(paper.h))
        {
          // Paper given: scale image to fit paper
-         BBox orig_box = p->bbox;
+         BBox orig_box = p->image_box;
          BBox paper_box = BBox(paper.w, paper.h);
          marg.shrink_box(&paper_box);
          xf.scale(scale_to_fit(orig_box, paper_box));
@@ -690,11 +690,11 @@ public:
       else
        {
          // No paper given: adjust paper to fit image
-         xf.shift(-p->bbox.x_min, -p->bbox.y_min);
+         xf.shift(-p->image_box.x_min, -p->image_box.y_min);
          xf.shift(marg.l, marg.b);
          q = new xform_page(p, xf);
-         q->width = p->bbox.width() + marg.l + marg.r;
-         q->height = p->bbox.height() + marg.t + marg.b;
+         q->width = p->image_box.width() + marg.l + marg.r;
+         q->height = p->image_box.height() + marg.t + marg.b;
        }
       return q;
     }
@@ -742,11 +742,11 @@ public:
   page *process_page(page *p) override
     {
       pdf_matrix xf;
-      xf.shift(-p->bbox.x_min, -p->bbox.y_min);
+      xf.shift(-p->image_box.x_min, -p->image_box.y_min);
       xf.shift(marg.l, marg.b);
       page *q = new xform_page(p, xf);
-      q->width = p->bbox.width() + marg.l + marg.r;
-      q->height = p->bbox.height() + marg.t + marg.b;
+      q->width = p->image_box.width() + marg.l + marg.r;
+      q->height = p->image_box.height() + marg.t + marg.b;
       if (q->width < 0.001 || q->height < 0.001)
        die("Margins must result in positive page dimensions");
       return q;
@@ -983,7 +983,7 @@ void nup_cmd::find_config(vector<page *> &in, BBox *page_boxes)
   for (int i=0; i<num_tiles; i++)
     {
       if (crop)
-       page_boxes[i] = in[i]->bbox;
+       page_boxes[i] = in[i]->image_box;
       else
        page_boxes[i] = BBox(in[i]->width, in[i]->height);
       st.tile_w = max(st.tile_w, page_boxes[i].width());
@@ -1082,8 +1082,8 @@ page *nup_cmd::process_single(vector<page *> &in)
   pdf_matrix place_xform = pos.place(grid_box, paper_box);
 
   nup_page *p = new nup_page(best);
-  p->bbox = grid_box;
-  p->bbox.transform(place_xform);
+  p->image_box = grid_box;
+  p->image_box.transform(place_xform);
 
   for (int i=0; i<num_tiles; i++)
     {