mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
For divecomputers without samples don't lose other data for profile
We create a fake divecomputer in order to draw a reasonable profile, but when setting that up we used an empty divecomputer instead of starting with the one that we have. This lost data (e.g., the model name of the dc). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
5cea16ec50
commit
6d69325185
1 changed files with 4 additions and 4 deletions
|
@ -2012,10 +2012,10 @@ void plot(struct graphics_context *gc, struct dive *dive, scale_mode_t scale)
|
|||
|
||||
if (!dc->samples) {
|
||||
static struct sample fake[4];
|
||||
static struct divecomputer fakedc = {
|
||||
.sample = fake,
|
||||
.samples = 4
|
||||
};
|
||||
static struct divecomputer fakedc;
|
||||
fakedc = dive->dc;
|
||||
fakedc.sample = fake;
|
||||
fakedc.samples = 4;
|
||||
|
||||
/* 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. */
|
||||
|
|
Loading…
Add table
Reference in a new issue