Gauge face adjustments
This commit is contained in:
parent
b7c3bcd81f
commit
b2de1920dd
3 changed files with 16 additions and 8 deletions
|
@ -30,13 +30,13 @@ void hexagram_cluster_resize(hexagram_cluster *cluster,
|
|||
width * 0.43,
|
||||
height * 0.76,
|
||||
height * 0.13,
|
||||
240.0);
|
||||
230.0);
|
||||
|
||||
hexagram_fuel_init(&cluster->fuel,
|
||||
width * 0.57,
|
||||
height * 0.76,
|
||||
height * 0.13,
|
||||
0.125);
|
||||
0.14);
|
||||
|
||||
hexagram_mfd_init(&cluster->mfd,
|
||||
width * 0.42,
|
||||
|
|
|
@ -52,6 +52,10 @@ void hexagram_fuel_draw_face(hexagram_fuel *fuel,
|
|||
* Draw gauge graduations
|
||||
*/
|
||||
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)) {
|
||||
cairo_set_source_rgb(cr, 1, 0, 0);
|
||||
} else {
|
||||
|
@ -60,7 +64,7 @@ void hexagram_fuel_draw_face(hexagram_fuel *fuel,
|
|||
|
||||
hexagram_gauge_draw_mark(&fuel->gauge,
|
||||
cr,
|
||||
(i % 4)? 0.8: 0.7,
|
||||
min_radius,
|
||||
0.9,
|
||||
(double)i / 16.0);
|
||||
}
|
||||
|
@ -80,5 +84,5 @@ void hexagram_fuel_draw_needle(hexagram_fuel *fuel,
|
|||
hexagram_gauge_draw_needle(&fuel->gauge,
|
||||
cr,
|
||||
0.9,
|
||||
level / 1.0);
|
||||
level);
|
||||
}
|
||||
|
|
12
src/thermo.c
12
src/thermo.c
|
@ -60,16 +60,20 @@ void hexagram_thermo_draw_face(hexagram_thermo *thermo,
|
|||
/*
|
||||
* Draw gauge graduations
|
||||
*/
|
||||
for (i=0; i<=140; i+=7) {
|
||||
if (i + 120 >= thermo->redline) {
|
||||
for (i=0; i<=16; i++) {
|
||||
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);
|
||||
}
|
||||
|
||||
hexagram_gauge_draw_mark(&thermo->gauge,
|
||||
cr,
|
||||
(i % 35)? 0.8: 0.7,
|
||||
min_radius,
|
||||
0.90,
|
||||
i / 140.0);
|
||||
i / 16.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue