From: Ian Jackson Date: Fri, 1 Mar 2019 13:00:35 +0000 (+0000) Subject: fix face ordering X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=6022901aee86039f86919331361633ec2980b4ab;p=pandemic-rising-tide.git fix face ordering --- diff --git a/generate-board b/generate-board index dd1455e..54a565f 100755 --- a/generate-board +++ b/generate-board @@ -277,21 +277,23 @@ sub face_path ($) { o(" closepath\n"); } -sub write_face_edges() { - o("5 setlinewidth 1 setlinejoin\n"); +sub fill_faces() { foreach my $rr (values %region) { next if $rr->{Name} eq 'L'; face_path($rr); - # xxx ordering: must do all fills then all strokes my $chex = $c{Colours}{$rr->{Colour}}; - if ($chex) { - o(" gsave "); - o(sprintf " %.6f ", hex($_) / 15.0) foreach split //, $chex; - o(" setrgbcolor eofill grestore\n"); - } - if ($rr->{Name} ne 'NZ') { - o(" stroke\n"); - } + next unless $chex; + o(sprintf " %.6f ", hex($_) / 15.0) foreach split //, $chex; + o(" setrgbcolor eofill\n"); + } +} + +sub edge_faces() { + o("5 setlinewidth 1 setlinejoin 0 setgray\n"); + foreach my $rr (values %region) { + next if $rr->{Name} eq 'L'; + face_path($rr); + o(" stroke\n"); } } @@ -308,7 +310,8 @@ adjust_nz(); o("%!\n"); o(" 0.52 dup scale\n"); # xxx bodge # xxx boundingbox -write_face_edges(); +fill_faces(); +edge_faces(); print STDERR Dumper(\%region) if $ENV{'GENERATE_BOARD_DUP'};