[gnome-clocks/wip/stopwatchlistbox] Progress also in the first second
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-clocks/wip/stopwatchlistbox] Progress also in the first second
- Date: Fri, 9 Aug 2013 15:44:06 +0000 (UTC)
commit 1af7d3273b4d32b00bca320aed0695b44e177dcd
Author: Paolo Borelli <pborelli gnome org>
Date: Fri Aug 9 17:42:54 2013 +0200
Progress also in the first second
src/stopwatch.vala | 18 ++++++++----------
1 files changed, 8 insertions(+), 10 deletions(-)
---
diff --git a/src/stopwatch.vala b/src/stopwatch.vala
index 56e3a7c..acbc731 100644
--- a/src/stopwatch.vala
+++ b/src/stopwatch.vala
@@ -102,19 +102,17 @@ public class AnalogFrame : Gtk.Frame {
cr.arc (center_x, center_y, radius, 0, 2 * Math.PI);
cr.stroke ();
- if (seconds > 0) {
- var progress = (seconds + millisecs) / 60;
- if (progress > 0) {
- cr.set_line_width (10);
- color = context.get_background_color (Gtk.StateFlags.SELECTED);
- cr.arc (center_x, center_y, radius, 1.5 * Math.PI, (1.5 + progress * 2 ) * Math.PI);
- Gdk.cairo_set_source_rgba (cr, color);
- cr.stroke ();
- }
+ var progress = ((double) seconds + millisecs) / 60;
+ if (progress > 0) {
+ cr.set_line_width (10);
+ color = context.get_background_color (Gtk.StateFlags.SELECTED);
+ cr.arc (center_x, center_y, radius, 1.5 * Math.PI, (1.5 + progress * 2 ) * Math.PI);
+ Gdk.cairo_set_source_rgba (cr, color);
+ cr.stroke ();
}
if (millisecs > 0) {
- var progress = millisecs;
+ progress = millisecs;
if (progress > 0) {
cr.set_line_width (2);
if (progress < (seconds + millisecs) / 60) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]