chiark / gitweb /
a4 boundings
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 7 Mar 2019 00:52:42 +0000 (00:52 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 7 Mar 2019 00:52:42 +0000 (00:52 +0000)
generate-board

index a6699d4b69649f221631d9199eab7dfb02da22fd..940235a93678e1991bc3b245692c9dbdc2e583a2 100755 (executable)
@@ -354,7 +354,11 @@ sub computeboundings() {
     $somepage->('P', 0,0, $a1_w, $a1_h);
     my $offx = 0.5*($bb{PageP}[2] - $bb{Entire}[2]);
     my $offy = 0.5*($bb{PageP}[3] - $bb{Entire}[3]);
+    my @hrect = @{ $bb{Entire} };
+    $bb{Entire}[0] += $offx;  $bb{Entire}[1] += $offy;
+    $bb{Entire}[2] += $offx;  $bb{Entire}[3] += $offy;
     if ($maxpaper eq 'a1m') {
+      @hrect = @{ $submargins->($a1m_pasteedge, \@hrect) };
       $bb{Cutout} = $submargins->($a1m_pasteedge, $bb{Entire});
     }
     $preamble_from_boundings = <<END;
@@ -369,18 +373,16 @@ sub computeboundings() {
              0 $hairs -2 mul rlineto
              stroke
          } def
-         0       0       a1hairs
-         $hairsw 0       a1hairs
-         0       $hairsh a1hairs
-         $hairsw $hairsh a1hairs
+         $hrect[0] $hrect[1] a1hairs
+         $hrect[0] $hrect[3] a1hairs
+         $hrect[2] $hrect[3] a1hairs
+         $hrect[2] $hrect[1] a1hairs
          -$surround -$surround moveto
           $surroundw 0         rlineto
           0 $surroundh         rlineto
           -$surroundw 0        rlineto
                  closepath clip
 END
-    $bb{Entire}[0] += $offx;  $bb{Entire}[1] += $offy;
-    $bb{Entire}[2] += $offx;  $bb{Entire}[3] += $offy;
     $top_adjuncts_dy_from_boundings = 35;
     $bottom_adjuncts_dy_from_boundings = -7;
   } else {