aboutsummaryrefslogtreecommitdiff
path: root/Perl/demos/Tk
diff options
context:
space:
mode:
Diffstat (limited to 'Perl/demos/Tk')
-rw-r--r--Perl/demos/Tk/demos/zinc_lib/fillrule.pl8
1 files changed, 6 insertions, 2 deletions
diff --git a/Perl/demos/Tk/demos/zinc_lib/fillrule.pl b/Perl/demos/Tk/demos/zinc_lib/fillrule.pl
index 9e7ab03..4d2dc1a 100644
--- a/Perl/demos/Tk/demos/zinc_lib/fillrule.pl
+++ b/Perl/demos/Tk/demos/zinc_lib/fillrule.pl
@@ -66,7 +66,7 @@ $zinc->add('text',$group, -position => [-110, 170], -text => "winding\nrules");
my $dy = 0;
foreach my $fillrule ('odd', 'nonzero', 'positive', 'negative', 'abs_geq_2') {
$dy += 160;
- $zinc->add('text',$group, -position => [-110, 100+$dy], -text => $fillrule);
+ $zinc->add('text',$group, -position => [-110, 100+$dy], -text => $fillrule eq 'odd' ? "odd\n(default)" : $fillrule);
foreach my $item ($curve1, $curve2, $curve3, $curve4) {
my $clone = $zinc->clone($item, -fillrule => $fillrule, -filled => 1);
$zinc->translate($clone, 0,$dy);
@@ -82,8 +82,12 @@ foreach my $item ($curve1, $curve2, $curve3, $curve4) {
# print " ",$#points,"points\n";
foreach my $i (0 .. $#points-1) {
# print " line $i ",$i+1,"\n";
+ $firstpoint = $points[$i];
+ $lastpoint = $points[$i+1];
+ $middlepoint = [$firstpoint->[0]+($lastpoint->[0]-$firstpoint->[0])/1.5,
+ $firstpoint->[1]+($lastpoint->[1]-$firstpoint->[1])/1.5];
$zinc->add("curve", $zinc->group($item),
- [ $points[$i], $points[$i+1] ],
+ [ $firstpoint, $middlepoint],
-lastend => [7,10,4]);
}
}