diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2011-11-19 14:39:35 -0500 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2011-11-19 15:12:29 -0500 |
commit | e1019cafa87058562d9f5844619841546029a57c (patch) | |
tree | 3458dc4946b572ff07a13d5c1aa6480c42c0a136 /profile.c | |
parent | 4e876b3082b46913d71e0f9bb6ff084aca4a2184 (diff) | |
download | subsurface-e1019cafa87058562d9f5844619841546029a57c.tar.gz |
Improve tank pressure sac coloring
This changes the algorithm that picks the sac color to consider
+/- 1 l/min to be the same color (before the color changed every
time you crossed above or below the average which looked silly with
our synthetic "constant sac" values as those are discrete and oscilate
around the average.
This also changes the order in which things are drawn so so that the
pressure plot goes over the depth profile plot (so the red shading of the
dive no longer changes the color of the tank pressure plot).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r-- | profile.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -620,14 +620,13 @@ static const rgb_t sac_color[SAC_COLORS] = { static void set_sac_color(struct graphics_context *gc, int sac, int avg_sac) { int sac_index = 0; - int delta = sac - avg_sac + 6000; + int delta = sac - avg_sac + 7000; sac_index = delta / 2000; if (sac_index < 0) sac_index = 0; if (sac_index > SAC_COLORS - 1) sac_index = SAC_COLORS - 1; - set_source_rgb_struct(gc, &sac_color[sac_index]); } @@ -1312,13 +1311,13 @@ void plot(struct graphics_context *gc, cairo_rectangle_int_t *drawing_area, stru /* Temperature profile */ plot_temperature_profile(gc, pi); - /* Cylinder pressure plot */ - plot_cylinder_pressure(gc, pi, dive); - /* Depth profile */ plot_depth_profile(gc, pi); plot_events(gc, pi, dive); + /* Cylinder pressure plot */ + plot_cylinder_pressure(gc, pi, dive); + /* Text on top of all graphs.. */ plot_temperature_text(gc, pi); plot_depth_text(gc, pi); |