From 57d0219e98c3ccb4b260d58a4264a9e02678e708 Mon Sep 17 00:00:00 2001 From: etienne Date: Fri, 5 Mar 2004 12:36:08 +0000 Subject: Corrections pour continuer � fonctionner en V3.297 --- Perl/demos/Tk/demos/zinc_lib/wheelOfFortune.pl | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'Perl/demos/Tk') diff --git a/Perl/demos/Tk/demos/zinc_lib/wheelOfFortune.pl b/Perl/demos/Tk/demos/zinc_lib/wheelOfFortune.pl index d2fe155..cf117a5 100644 --- a/Perl/demos/Tk/demos/zinc_lib/wheelOfFortune.pl +++ b/Perl/demos/Tk/demos/zinc_lib/wheelOfFortune.pl @@ -274,7 +274,7 @@ sub _close { my $group = $self->{topgroup}; # first step of animation if ($cnt == 0) { - my @pos = $widget->coords($group)}; + my @pos = $widget->coords($group); $x = ($x - $pos[0])/$self->{stepsnumber}; $y = ($y - $pos[1])/$self->{stepsnumber}; # last step @@ -325,7 +325,7 @@ sub _fortune { my $zf; my $widget = $self->{widget}; my $group = $self->{topgroup}; - my @pos = $widget->coords($group)}; + my @pos = $widget->coords($group); # last step of animation if ($cnt == 6) { $self->{fortune} = undef; @@ -356,11 +356,17 @@ sub _fortune { # Update group clipping and translation, using 'scale' and 'translate' # Zinc methods. sub _clipAndTranslate { + my ($self, $shrinkfactor, $x, $y) = @_; $x = 0 unless $x; $y = 0 unless $y; $self->{widget}->scale($self->{itemclip}, $shrinkfactor, $shrinkfactor); - $self->{widget}->translate($self->{topgroup}, $x, $y); + if ($Tk::Zinc::VERSION lt "3.297") { + $self->{widget}->translate($self->{topgroup}, $x, $y); + } else { + my ($xc, $yc) = $self->{widget}->coords($self->{topgroup}); + $self->{widget}->coords($self->{topgroup}, [$xc + $x, $yc + $y]); + } } -- cgit v1.1