[Xfce4-commits] <ristretto:master> Smooth the hour-indicator
Stephan Arts
noreply at xfce.org
Mon Apr 16 18:54:10 CEST 2012
Updating branch refs/heads/master
to c1532d2e4e810e64207a1bfbe18f25624d9bff02 (commit)
from 876972b93832b91fc797179053b7dc8b56e676e0 (commit)
commit c1532d2e4e810e64207a1bfbe18f25624d9bff02
Author: Stephan Arts <stephan at xfce.org>
Date: Mon Apr 16 18:11:15 2012 +0200
Smooth the hour-indicator
src/image_viewer.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/image_viewer.c b/src/image_viewer.c
index 0cc6154..3ee066d 100644
--- a/src/image_viewer.c
+++ b/src/image_viewer.c
@@ -1014,6 +1014,8 @@ paint_clock (
time_t t = time(NULL);
struct tm *lt = localtime(&t);
+ gdouble hour_angle = (gdouble)(M_PI*2)/12*((gdouble)(lt->tm_hour%12+6)+((M_PI*2)/720.0*(gdouble)lt->tm_min));
+
cairo_save (ctx);
cairo_translate (
@@ -1059,7 +1061,7 @@ paint_clock (
cairo_set_line_cap (ctx, CAIRO_LINE_CAP_ROUND);
cairo_rotate (
ctx,
- (M_PI*2)/12*(lt->tm_hour%12+6));
+ hour_angle);
cairo_move_to (ctx, 0, 0);
cairo_line_to (
ctx,
More information about the Xfce4-commits
mailing list