From 8b027be4dc4bcb8fcdb2744e0d8fc65734bb206a Mon Sep 17 00:00:00 2001 From: lecoanet Date: Tue, 6 Mar 2007 09:28:05 +0000 Subject: Update aclocal fo GLEW --- Perl/demos/Tk/demos/zinc_lib/simpleradar.pl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'Perl/demos/Tk') diff --git a/Perl/demos/Tk/demos/zinc_lib/simpleradar.pl b/Perl/demos/Tk/demos/zinc_lib/simpleradar.pl index 12c45a9..06cec3c 100644 --- a/Perl/demos/Tk/demos/zinc_lib/simpleradar.pl +++ b/Perl/demos/Tk/demos/zinc_lib/simpleradar.pl @@ -52,7 +52,9 @@ my $rate = 0.3; my %tracks = (); my $pause = 0; # if true the flight are no more moving -my $zinc = $mw->Zinc(-backcolor => 'gray65', +my $zinc = $mw->Zinc(-render => 1, + -enablerotation => 1, + -backcolor => 'gray65', -relief => 'sunken', -font => "10x20"); $zinc->pack(-expand => 1, -fill => 'both'); @@ -61,6 +63,9 @@ $zinc->configure(-width => $zinc_width, -height => $zinc_height); my $radar = $zinc->add('group', $top, -tags => ['controls', 'radar']); $zinc->configure(-overlapmanager => $radar); +my $rotation = 0; +$zinc->Tk::bind('', sub { $rotation += 10; $zinc->configure(-screenrotation => $rotation); }); +$zinc->Tk::bind('', sub { $rotation -= 10; $zinc->configure(-screenrotation => $rotation); }); ################################################### # creation panneau controle @@ -127,7 +132,10 @@ sub update_transform { $zinc->translate($top, -$center_x, -$center_y); $zinc->scale($top, $scale, $scale); $zinc->scale($top, 1, -1); - $zinc->translate($top, $zinc_width/2, $zinc_height/2); + my $virtualSize = sqrt($zinc_width*$zinc_width + $zinc_height*$zinc_height); + my $hVirtualSize = $virtualSize/2; + $zinc->translate($top, $hVirtualSize, $hVirtualSize); + #$zinc->translate($top, $zinc_width/2, $zinc_height/2); } -- cgit v1.1