Gauge face adjustments

This commit is contained in:
XANTRONIX Development 2019-06-28 18:10:01 -05:00
parent b7c3bcd81f
commit b2de1920dd
3 changed files with 16 additions and 8 deletions

View file

@ -30,13 +30,13 @@ void hexagram_cluster_resize(hexagram_cluster *cluster,
width * 0.43, width * 0.43,
height * 0.76, height * 0.76,
height * 0.13, height * 0.13,
240.0); 230.0);
hexagram_fuel_init(&cluster->fuel, hexagram_fuel_init(&cluster->fuel,
width * 0.57, width * 0.57,
height * 0.76, height * 0.76,
height * 0.13, height * 0.13,
0.125); 0.14);
hexagram_mfd_init(&cluster->mfd, hexagram_mfd_init(&cluster->mfd,
width * 0.42, width * 0.42,

View file

@ -52,6 +52,10 @@ void hexagram_fuel_draw_face(hexagram_fuel *fuel,
* Draw gauge graduations * Draw gauge graduations
*/ */
for (i=0; i<=16; i++) { for (i=0; i<=16; i++) {
double min_radius = (i <= 4)?
(i % 2? 0.8: 0.7):
(i % 4? 0.8: 0.7);
if (i <= (16.0 * fuel->redline)) { if (i <= (16.0 * fuel->redline)) {
cairo_set_source_rgb(cr, 1, 0, 0); cairo_set_source_rgb(cr, 1, 0, 0);
} else { } else {
@ -60,7 +64,7 @@ void hexagram_fuel_draw_face(hexagram_fuel *fuel,
hexagram_gauge_draw_mark(&fuel->gauge, hexagram_gauge_draw_mark(&fuel->gauge,
cr, cr,
(i % 4)? 0.8: 0.7, min_radius,
0.9, 0.9,
(double)i / 16.0); (double)i / 16.0);
} }
@ -80,5 +84,5 @@ void hexagram_fuel_draw_needle(hexagram_fuel *fuel,
hexagram_gauge_draw_needle(&fuel->gauge, hexagram_gauge_draw_needle(&fuel->gauge,
cr, cr,
0.9, 0.9,
level / 1.0); level);
} }

View file

@ -60,16 +60,20 @@ void hexagram_thermo_draw_face(hexagram_thermo *thermo,
/* /*
* Draw gauge graduations * Draw gauge graduations
*/ */
for (i=0; i<=140; i+=7) { for (i=0; i<=16; i++) {
if (i + 120 >= thermo->redline) { double min_radius = (i >= 14)?
(i % 2? 0.8: 0.7):
(i % 4? 0.8: 0.7);
if ((i * 8.23529411) + 120 >= thermo->redline) {
cairo_set_source_rgb(cr, 1, 0, 0); cairo_set_source_rgb(cr, 1, 0, 0);
} }
hexagram_gauge_draw_mark(&thermo->gauge, hexagram_gauge_draw_mark(&thermo->gauge,
cr, cr,
(i % 35)? 0.8: 0.7, min_radius,
0.90, 0.90,
i / 140.0); i / 16.0);
} }
} }