diff options
author | vinot | 2003-07-03 14:33:08 +0000 |
---|---|---|
committer | vinot | 2003-07-03 14:33:08 +0000 |
commit | d91e670155aec1deaf3694d0f1e10f928c217660 (patch) | |
tree | fb4e83d29f14e69d878c1848afe6abd4f43737c1 | |
parent | 18d80e2d8e3fca7fcbe125a484e8eda150cd969f (diff) | |
download | tkzinc-d91e670155aec1deaf3694d0f1e10f928c217660.zip tkzinc-d91e670155aec1deaf3694d0f1e10f928c217660.tar.gz tkzinc-d91e670155aec1deaf3694d0f1e10f928c217660.tar.bz2 tkzinc-d91e670155aec1deaf3694d0f1e10f928c217660.tar.xz |
correction bugs
-rw-r--r-- | Perl/Zinc/Graphics.pm | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/Perl/Zinc/Graphics.pm b/Perl/Zinc/Graphics.pm index 3db1b38..7eaf606 100644 --- a/Perl/Zinc/Graphics.pm +++ b/Perl/Zinc/Graphics.pm @@ -143,7 +143,8 @@ sub buildZincItem { if ($style->{'-contours'}) { my @contours = @{$style->{'-contours'}}; my $numcontours = scalar(@contours); - for (my $i = 0; $i < $numcontours; $i++) { + my $i; + for ($i = 0; $i < $numcontours; $i++) { # radius et corners peuvent être défini spécifiquement pour chaque contour my ($type, $way, $coords, $radius, $corners, $corners_radius) = @{$contours[$i]}; $radius = $style->{'-radius'} if (!defined $radius); @@ -338,7 +339,8 @@ sub roundedRectangleCoords { [[$xn, $y2],[$xn, $y1, 'c'],[$x4, $y0, 'c'],[$x3, $y0],]); my @pts = (); - for (my $i = 0; $i < 4; $i++) { + my $i; + for ($i = 0; $i < 4; $i++) { if ($corners->[$i]) { push(@pts, @{$roundeds[$i]}); @@ -429,7 +431,8 @@ sub polygonCoords { my @pts; # points du polygone - for (my $i = 0; $i < $numsides; $i++) { + my $i; + for ($i = 0; $i < $numsides; $i++) { my ($xp, $yp) = &rad_point($cx, $cy, $radius, $startangle + ($anglestep*$i)); push(@pts, ([$xp, $yp])); @@ -650,7 +653,8 @@ sub pathLineCoords { my $next = $coords->[1]; $linewidth /= 2 if ($shifting eq 'both'); - for (my $i = 0; $i < $numfaces; $i++) { + my $i; + for ($i = 0; $i < $numfaces; $i++) { my $pt = $coords->[$i]; if (!$previous) { @@ -951,8 +955,9 @@ sub tabBoxCoords { ($anchor eq 'w' and $alignment ne 'right')) { if (ref($len) eq 'ARRAY') { - for (my $i = 0; $i < $numpages; $i++) { - $len->[$i] *= -1; + my $p; + for ($p = 0; $p < $numpages; $p++) { + $len->[$p] *= -1; } } else { $len *= -1; @@ -999,8 +1004,8 @@ sub tabBoxCoords { $inverse = (($anchor eq 'n' and $alignment ne 'right') or ($anchor eq 's' and $alignment eq 'right')); } - - for (my $i = 0; $i < $numpages; $i++) { + my $i; + for ($i = 0; $i < $numpages; $i++) { my @pts = (); # décrochage onglet @@ -1026,7 +1031,7 @@ sub tabBoxCoords { @{$curvepts} = reverse @{$curvepts} if ($inverse); push (@shapes, $curvepts); } else { - reverse @pts if ($inverse); + @pts = reverse @pts if ($inverse); push (@shapes, \@pts); } @@ -1195,6 +1200,8 @@ sub pathGraduate { my $type = $style->{'-type'}; my $triangles_colors; + my $i; + if ($type eq 'linear') { return &createGraduate($zinc, $numcolors, $style->{'-colors'}, 2); @@ -1202,7 +1209,7 @@ sub pathGraduate { my $colors1 = &createGraduate($zinc, $numcolors/2+1, $style->{'-colors'}->[0]); my $colors2 = &createGraduate($zinc, $numcolors/2+1, $style->{'-colors'}->[1]); my @colors; - for (my $i = 0; $i <= $numcolors; $i++) { + for ($i = 0; $i <= $numcolors; $i++) { push(@colors, ($colors1->[$i], $colors2->[$i])); } @@ -1211,7 +1218,7 @@ sub pathGraduate { } elsif ($type eq 'transversal') { my ($c1, $c2) = @{$style->{'-colors'}}; my @colors = ($c1, $c2); - for (my $i = 0; $i < $numcolors; $i++) { + for ($i = 0; $i < $numcolors; $i++) { push(@colors, ($c1, $c2)); } @@ -1237,19 +1244,19 @@ sub createGraduate { } my $steps = ($numgraduates > 1) ? $totalsteps/($numgraduates -1) : $totalsteps; - - for (my $c = 0; $c < $numgraduates; $c++) { + my ($c, $k); + for ($c = 0; $c < $numgraduates; $c++) { my ($c1, $c2) = ($refcolors->[$c], $refcolors->[$c+1]); - for (my $i = 0 ; $i < $steps ; $i++) { + for ($i = 0 ; $i < $steps ; $i++) { my $color = computeColor($widget, $c1, $c2, $i/($steps-1)); - for (my $k = 0; $k < $repeat; $k++) { + for ($k = 0; $k < $repeat; $k++) { push (@colors, $color); } } if ($c < $numgraduates - 1) { - for (my $k = 0; $k < $repeat; $k++) { + for ($k = 0; $k < $repeat; $k++) { pop @colors; } } |