my $nrows = ceil($total / $rowsz);
my $ix = 0;
print "// total=$total, rowsz=$rowsz, nrows=$nrows\n";
- foreach my $ndots (sort keys %$cs) {
- my $c = $cs->{$ndots};
+ foreach my $nspots (sort keys %$cs) {
+ my $c = $cs->{$nspots};
print <<END;
union(){
- \$ndots = $ndots;
+ Frame(\$phase, token_pitch * [ $rowsz + 0.5, $nrows ]);
+ \$nspots = $nspots;
END
while ($c--) {
my $xy = sprintf "[ %5.1f, %5.1f ]",
- $ix / $nrows - 0.5 * $rowsz,
- $ix % $nrows - 0.5 * $nrows;
+ int($ix / $nrows) - 0.5 * ($rowsz-1),
+ $ix % $nrows - 0.5 * ($nrows-1);
print " translate(token_pitch * $xy) Token_L();\n";
$ix++;
}