| 1 |
Author: Jason <[email protected]> |
| 2 |
Last-Update: 2018-08-23 |
| 3 |
Bug-Debian: https://bugs.debian.org/907029 |
| 4 |
Forwarded: https://github.com/rosorio/buici-clock/pull/1 |
| 5 |
Description: Fix showSecondHand |
| 6 |
|
| 7 |
--- a/clock.cxx |
| 8 |
+++ b/clock.cxx |
| 9 |
@@ -107,7 +107,8 @@ time_t calc_delta (time_t); |
| 10 |
void draw_dial (Display* display, Visual* visual, |
| 11 |
Pixmap pixmap, int dx, int dy); |
| 12 |
void draw_hands (Display* display, Visual* visual, |
| 13 |
- Pixmap pixmap, int dx, int dy, int seconds); |
| 14 |
+ Pixmap pixmap, int dx, int dy, int seconds, |
| 15 |
+ bool showSecondHand); |
| 16 |
void draw_dial_shape (Display* display, Pixmap pixmap, int dx, int dy); |
| 17 |
|
| 18 |
class WTopLevel : public LWindow { |
| 19 |
@@ -539,7 +540,7 @@ bool WTopLevel::render (void) |
| 20 |
_gc, 0, 0, width (), height (), 0, 0); |
| 21 |
|
| 22 |
|
| 23 |
- draw_hands (xdisplay (), xvisual (), pixmap, width (), height (), seconds); |
| 24 |
+ draw_hands (xdisplay (), xvisual (), pixmap, width (), height (), seconds, m_fSecondHand); |
| 25 |
|
| 26 |
#if 0 |
| 27 |
// -- Draw hands |
| 28 |
--- a/draw.cc |
| 29 |
+++ b/draw.cc |
| 30 |
@@ -147,7 +147,8 @@ void draw (void) |
| 31 |
|
| 32 |
|
| 33 |
void draw_hands (Display* display, Visual* visual, |
| 34 |
- Pixmap pixmap, int dx, int dy, int seconds) |
| 35 |
+ Pixmap pixmap, int dx, int dy, int seconds, |
| 36 |
+ bool showSecondHand) |
| 37 |
{ |
| 38 |
cairo_surface_t* s = cairo_xlib_surface_create (display, pixmap, visual, |
| 39 |
dx, dy); |
| 40 |
@@ -200,6 +201,7 @@ void draw_hands (Display* display, Visua |
| 41 |
cairo_path_destroy (path); |
| 42 |
|
| 43 |
// Second hand |
| 44 |
+ if (showSecondHand){ |
| 45 |
cairo_save (cr); |
| 46 |
cairo_rotate (cr, ((2.0*M_PI)*seconds)/60.0); |
| 47 |
cairo_set_line_width (cr, WIDTH_THIN); |
| 48 |
@@ -211,6 +213,7 @@ void draw_hands (Display* display, Visua |
| 49 |
cairo_fill (cr); |
| 50 |
cairo_restore (cr); |
| 51 |
} |
| 52 |
+ } |
| 53 |
|
| 54 |
cairo_destroy (cr); |
| 55 |
} |