Fix some warm and bad comments, code
This commit is contained in:
parent
7cd217bef4
commit
f5624bfd4e
1 changed files with 16 additions and 17 deletions
33
src/gauge.c
33
src/gauge.c
|
@ -24,23 +24,6 @@ void hexagram_gauge_draw_number(hexagram_gauge *gauge,
|
||||||
double angle = gauge->min_angle
|
double angle = gauge->min_angle
|
||||||
+ ((gauge->max_angle - gauge->min_angle) * value) - 1.658;
|
+ ((gauge->max_angle - gauge->min_angle) * value) - 1.658;
|
||||||
|
|
||||||
/*
|
|
||||||
* Draw the gauge pivot
|
|
||||||
*/
|
|
||||||
cairo_set_source_rgb(cr, 1, 1, 1);
|
|
||||||
|
|
||||||
cairo_arc(cr,
|
|
||||||
gauge->x,
|
|
||||||
gauge->y,
|
|
||||||
gauge->radius * 0.08,
|
|
||||||
0,
|
|
||||||
2.0 * M_PI);
|
|
||||||
|
|
||||||
cairo_stroke(cr);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Draw the needle atop the gauge pivot
|
|
||||||
*/
|
|
||||||
cairo_set_source_rgb(cr, 1, 1, 1);
|
cairo_set_source_rgb(cr, 1, 1, 1);
|
||||||
|
|
||||||
cairo_move_to(cr,
|
cairo_move_to(cr,
|
||||||
|
@ -80,6 +63,22 @@ void hexagram_gauge_draw_needle(hexagram_gauge *gauge,
|
||||||
double angle = gauge->min_angle
|
double angle = gauge->min_angle
|
||||||
+ ((gauge->max_angle - gauge->min_angle) * value) - (M_PI / 2.0);
|
+ ((gauge->max_angle - gauge->min_angle) * value) - (M_PI / 2.0);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Draw the gauge pivot
|
||||||
|
*/
|
||||||
|
cairo_set_source_rgb(cr, 1, 1, 1);
|
||||||
|
|
||||||
|
cairo_arc(cr,
|
||||||
|
gauge->x,
|
||||||
|
gauge->y,
|
||||||
|
gauge->radius * 0.08,
|
||||||
|
0,
|
||||||
|
2.0 * M_PI);
|
||||||
|
|
||||||
|
cairo_stroke(cr);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Draw the needle above the pivot */
|
||||||
cairo_move_to(cr, gauge->x, gauge->y);
|
cairo_move_to(cr, gauge->x, gauge->y);
|
||||||
|
|
||||||
cairo_set_source_rgb(cr, 0, 0.25, 1.0);
|
cairo_set_source_rgb(cr, 0, 0.25, 1.0);
|
||||||
|
|
Loading…
Add table
Reference in a new issue