summaryrefslogtreecommitdiffstats
path: root/clock.pl
diff options
context:
space:
mode:
authorThierry Vignaud <tvignaud@mandriva.org>2003-03-10 13:00:50 +0000
committerThierry Vignaud <tvignaud@mandriva.org>2003-03-10 13:00:50 +0000
commitb5a6bc2043b8edb705297f5b474f1512148672a0 (patch)
treeffe334e01a715c51097d2091a4afb9ec4e1974c5 /clock.pl
parentba5e66f77cd1eed0787929c7eb3756c3bad1526f (diff)
downloadcontrol-center-b5a6bc2043b8edb705297f5b474f1512148672a0.tar
control-center-b5a6bc2043b8edb705297f5b474f1512148672a0.tar.gz
control-center-b5a6bc2043b8edb705297f5b474f1512148672a0.tar.bz2
control-center-b5a6bc2043b8edb705297f5b474f1512148672a0.tar.xz
control-center-b5a6bc2043b8edb705297f5b474f1512148672a0.zip
- fix #156 (7:00 display)
- (determine_radian) : remove useless second returned value
Diffstat (limited to 'clock.pl')
-rwxr-xr-xclock.pl10
1 files changed, 4 insertions, 6 deletions
diff --git a/clock.pl b/clock.pl
index 90288bf7..d92f44a7 100755
--- a/clock.pl
+++ b/clock.pl
@@ -16,7 +16,6 @@ my $pixmap;
my $radius;
my ($dRadians_hour, $dRadians_min, $dRadians_sec);
my $Radian;
-my $type;
my $timer;
my ($midx, $midy);
my $first = 1;
@@ -176,7 +175,7 @@ sub motion_event {
$pressed or return;
if ($first) {
Gtk2->timeout_remove($timer);
- ($Radian, $type) = determine_radian($event->x, $event->y);
+ $Radian = determine_radian($event->x, $event->y);
$button_reset->set_sensitive(1);
}
@@ -192,13 +191,12 @@ sub determine_radian {
my $res;
my $r;
- my $i = 0;
foreach (\$dRadians_hour, \$dRadians_min, \$dRadians_sec) {
my $d = sqrt( ($x - ($midx + 7/10 * $radius * sin($$_)))**2 + ($y - ($midy - 7/10 * $radius * cos($$_)))**2);
$res or $res = $d, $r = $_;
- $d < $res and $res = $d, $r = $_, $i++;
+ $d < $res and $res = $d, $r = $_;
}
- ($r, $i);
+ $r;
}
sub expose_event {
@@ -228,7 +226,7 @@ sub Repaint {
my ($drawing_area, $update_time) = @_;
time_to_rad(localtime(time())) if $update_time;
my ($width, $height) = ($drawing_area->allocation->width, $drawing_area->allocation->height);
- my $dRadians_hour_real = POSIX::floor($dRadians_hour / $PI*6) * $PI/6.0 + $dRadians_min / 12;
+ my $dRadians_hour_real = $dRadians_hour + $dRadians_min / 12;
my $dRadians_min_real = POSIX::floor($dRadians_min / $PI * 30) * $PI / 30;
my $dRadians_sec_real = $dRadians_sec;
$pixmap->draw_rectangle($drawing_area->style->white_gc, 1, 0, 0, $width, $height);