chiark / gitweb /
introduce pos_plus_dy_adjunct
[pandemic-rising-tide.git] / generate-board
index 1cc324280a60cdb0ef2c3ffec89794209e5bfdf2..c801bedb2998b17318148e6f08206cd24dec895e 100755 (executable)
@@ -245,6 +245,13 @@ sub transform_coordinates () {
   $mid = ($lims[1] - $lims[0]) * 0.5;
 }
 
+sub pos_plus_dy_adjunct ($) {
+  my ($cval) = @_;
+  my ($x,$y,$whadjunct) = @$cval;
+  my $adjunct = $adjuncts_dy_from_boundings{ $whadjunct };
+  return "$x $y ".( defined $adjunct and "$adjunct add translate" );
+}
+
 sub adjust_sea() {
   # Adjusts the top and bottom edges of the sea
   my $poly = $region{$c{Sea}}{Polygon};
@@ -778,10 +785,7 @@ sub decks(){
 
   foreach my $deck (@{ $c{Decks} }) {
     o("  $lw setlinewidth ",miscpscolour($deck->{Colour}),"\n");
-    o("  gsave @{ $deck->{Pos} } ");
-    my $adjunct = $adjuncts_dy_from_boundings{ $deck->{dyAdjunct} };
-    if (defined $adjunct) { o("$adjunct add translate"); }
-    o("     ");
+    o("  gsave ".pos_plus_dy_adjunct($deck->{PosAdy})."     ");
     my $rotate = $deck->{Rotate};
     if ($rotate) { o(" $rotate rotate "); }
     o("deckpairpathx stroke grestore");