aboutsummaryrefslogtreecommitdiff
path: root/Perl/demos/Tk
diff options
context:
space:
mode:
authormertz2003-03-13 16:06:05 +0000
committermertz2003-03-13 16:06:05 +0000
commit8c56263908d22ca7a75ddde82a363c8b40051233 (patch)
tree72e02241980dbeb5375272d755420132d6f22f83 /Perl/demos/Tk
parent87a833153a9ccb8736d54c2f7162b9d562cb0677 (diff)
downloadtkzinc-8c56263908d22ca7a75ddde82a363c8b40051233.zip
tkzinc-8c56263908d22ca7a75ddde82a363c8b40051233.tar.gz
tkzinc-8c56263908d22ca7a75ddde82a363c8b40051233.tar.bz2
tkzinc-8c56263908d22ca7a75ddde82a363c8b40051233.tar.xz
- arrows are now somewhere in the middle of each segment
- the default fillrule is mentionned (odd)
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]);
}
}