Getting moody
This commit is contained in:
parent
1395293091
commit
2871fd974a
3 changed files with 7 additions and 15 deletions
16
src/fuel.c
16
src/fuel.c
|
@ -69,22 +69,12 @@ void hexagram_fuel_draw_face(hexagram_fuel *fuel,
|
|||
void hexagram_fuel_draw_needle(hexagram_fuel *fuel,
|
||||
cairo_t *cr,
|
||||
double level) {
|
||||
if (level > 1.0) {
|
||||
if (level < 0.0) {
|
||||
level = 0.0;
|
||||
} else if (level > 1.0) {
|
||||
level = 1.0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Draw a tiny boi circle
|
||||
*/
|
||||
cairo_set_source_rgb(cr, 1, 1, 1);
|
||||
|
||||
cairo_arc(cr,
|
||||
fuel->gauge.x,
|
||||
fuel->gauge.y,
|
||||
fuel->gauge.radius * 0.08,
|
||||
0,
|
||||
2.0 * M_PI);
|
||||
|
||||
cairo_stroke(cr);
|
||||
|
||||
hexagram_gauge_draw_needle(&fuel->gauge,
|
||||
|
|
|
@ -66,7 +66,7 @@ void hexagram_gauge_draw_needle(hexagram_gauge *gauge,
|
|||
/*
|
||||
* Draw the gauge pivot
|
||||
*/
|
||||
cairo_set_source_rgb(cr, 1, 1, 1);
|
||||
cairo_set_source_rgb(cr, 0.1, 0.1, 0.1);
|
||||
|
||||
cairo_arc(cr,
|
||||
gauge->x,
|
||||
|
|
|
@ -61,7 +61,9 @@ void hexagram_speedo_draw_face(hexagram_speedo *speedo,
|
|||
void hexagram_speedo_draw_needle(hexagram_speedo *speedo,
|
||||
cairo_t *cr,
|
||||
double kph) {
|
||||
if (kph > 290) {
|
||||
if (kph < 0) {
|
||||
kph = 0;
|
||||
} else if (kph > 290) {
|
||||
kph = 290;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue