chiark / gitweb /
refactor to prep for multi on a1[m] nfc
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 8 Mar 2019 10:36:08 +0000 (10:36 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Fri, 8 Mar 2019 10:36:08 +0000 (10:36 +0000)
generate-board

index 24c9eeb9661bfaa17b8cad94b1f2f65ecfb50110..dbba9581c1b7f17c4d746c17e17dff5aa415f0c8 100755 (executable)
@@ -393,7 +393,7 @@ END
 
 sub showboundings () {
   return unless $xopts =~ m/B/;
-  o("  grestore gsave\n");
+  o(" gsave\n");
   my $bb = $bb{$bounding};
   o("  $bb->[0] neg $bb->[1] neg translate\n");
   my $i = 0;
@@ -414,6 +414,7 @@ sub showboundings () {
     o("    closepath stroke\n");
     $i++;
   }
+  o(" grestore");
 }
 
 sub o_amble (@) {
@@ -437,11 +438,21 @@ sub preamble() {
 &&EndProlog
 &&BeginSetup
 << /PageSize [ @$sz ] >> setpagedevice
-/board {
+/all {
   gsave
   $bb->[0] neg  $bb->[1] neg  translate
   $preamble_from_boundings
-
+  board
+  grestore
+  showboundings
+} def
+/showboundings {
+END
+  showboundings();
+  o_amble(<<END);
+} def
+/board {
+  gsave
   % adjustment to actual image placement within prinable areas etc.:
   34 -15 translate
 END
@@ -453,13 +464,13 @@ END
 sub postamble () {
   o_amble(<<END);
   grestore
-} bind def
+} def % board
 &&EndSetup
 &&Page: 1
 &&BeginPageSetup
 /pgsave save def
 &&EndPageSetup
-board
+all
 pgsave restore
 showpage
 &&EOF
@@ -966,7 +977,6 @@ decks();
 sea_track();
 hs_initial();
 play_hint();
-showboundings();
 postamble();
 
 print STDERR Dumper(\%region) if $ENV{'GENERATE_BOARD_DUP'};