diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2012-12-16 22:02:42 -1000 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-12-16 22:05:11 -1000 |
commit | a691a8e5a35f2277d9a8c911696a4d0a394bb42e (patch) | |
tree | 039aae2189d123b18ec03311bd3608f3c5acc46f /profile.c | |
parent | 33ae98c96f9e9564085fd6fc49f9a77fcf0fa331 (diff) | |
download | subsurface-a691a8e5a35f2277d9a8c911696a4d0a394bb42e.tar.gz |
Improve visual appearance of horizontal marker lines
This changes two things to improve the appearance of the profile:
- the partial pressure scale is now in 0.5 increments if the total is <= 4
and in 1.0 increments if it is > 4.
- the depth marker lines end slightly below the depth chart so that we no
longer have overlap between the depth scale and the partial pressure
scale.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r-- | profile.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -552,7 +552,7 @@ static void plot_pp_text(struct graphics_context *gc, struct plot_info *pi) setup_pp_limits(gc, pi); pp = floor(pi->maxpp * 10.0) / 10.0 + 0.2; - dpp = floor(2.0 * pp) / 10.0; + dpp = pp > 4 ? 1.0 : 0.5; hpos = pi->entry[pi->nr - 1].sec; set_source_rgba(gc, PP_LINES); for (m = 0.0; m <= pp; m += dpp) { @@ -653,7 +653,7 @@ static void plot_depth_profile(struct graphics_context *gc, struct plot_info *pi cairo_t *cr = gc->cr; int sec, depth; struct plot_data *entry; - int maxtime, maxdepth, marker; + int maxtime, maxdepth, marker, maxline; int increments[8] = { 10, 20, 30, 60, 5*60, 10*60, 15*60, 30*60 }; /* Get plot scaling limits */ @@ -705,9 +705,9 @@ static void plot_depth_profile(struct graphics_context *gc, struct plot_info *pi case METERS: marker = 10000; break; case FEET: marker = 9144; break; /* 30 ft */ } - + maxline = MAX(pi->maxdepth + marker, maxdepth * 2 / 3); set_source_rgba(gc, DEPTH_GRID); - for (i = marker; i < maxdepth; i += marker) { + for (i = marker; i < maxline; i += marker) { move_to(gc, 0, i); line_to(gc, 1, i); } |