Make that a bit easier to read

This commit is contained in:
XANTRONIX Development 2019-06-13 23:59:47 -05:00
parent 3549fff6d6
commit 1395293091

View file

@ -76,12 +76,16 @@ void hexagram_thermo_draw_face(hexagram_thermo *thermo,
void hexagram_thermo_draw_needle(hexagram_thermo *thermo, void hexagram_thermo_draw_needle(hexagram_thermo *thermo,
cairo_t *cr, cairo_t *cr,
double temp) { double temp) {
if (temp > 260) { double fahrenheit = temp * (9.0 / 5.0) + 32.0;
temp = 260;
if (fahrenheit < 120) {
fahrenheit = 120;
} else if (fahrenheit > 260) {
fahrenheit = 260;
} }
hexagram_gauge_draw_needle(&thermo->gauge, hexagram_gauge_draw_needle(&thermo->gauge,
cr, cr,
0.9, 0.9,
((temp * (9.0/5.0) + 32.0) - 120) / 140.0); (fahrenheit - 120) / 140.0);
} }