diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-17 10:57:24 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-08-17 10:57:24 -0700 |
commit | d0e27c6c533005b5fd161286f68f1325bdabe8e3 (patch) | |
tree | 37d7fe231cd6c9e8d4acc7bba243b9fd456f70c1 /profile.c | |
parent | 589589c707262920a4c9ffc258704e30fa62b8fa (diff) | |
parent | 549708c6eaab2d0592c3e520e0debd82d64619b4 (diff) | |
download | subsurface-d0e27c6c533005b5fd161286f68f1325bdabe8e3.tar.gz |
Merge branch 'misc-fixes' of git://github.com/DataBeaver/subsurface
Pull miscellaneous fixes, mostly UI stuff from Mikko Rasa.
Both this and the pull from Pierre-Yves Chibon created a "Save As" menu
entry and logic. As a result, there were a fair number of conflicts,
but I tried to make the end result somewhat reasonable. I might have
missed some semantic conflict, though.
Series-acked-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no>
* 'misc-fixes' of git://github.com/DataBeaver/subsurface:
Add a separate "Save as" entry to the menu
Changes to menu icons
Improved depth info for dives without samples
Divide the panes evenly in view_three
Diffstat (limited to 'profile.c')
-rw-r--r-- | profile.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -1355,12 +1355,15 @@ void plot(struct graphics_context *gc, cairo_rectangle_int_t *drawing_area, stru int nr = dive->samples; if (!nr) { + /* The dive has no samples, so create a few fake ones. This assumes an + ascent/descent rate of 9 m/min, which is just below the limit for FAST. */ int duration = dive->duration.seconds; int maxdepth = dive->maxdepth.mm; + int asc_desc_time = dive->maxdepth.mm*60/9000; sample = fake; - fake[1].time.seconds = duration * 0.05; + fake[1].time.seconds = asc_desc_time; fake[1].depth.mm = maxdepth; - fake[2].time.seconds = duration * 0.95; + fake[2].time.seconds = duration - asc_desc_time; fake[2].depth.mm = maxdepth; fake[3].time.seconds = duration * 1.00; nr = 4; |