mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Fix dive planner sidebar depth units
The dive planner always showed the depth in our internal units, ie millimeter, in the sidebar that showed the plan points. That made little sense in metric mode, and none at all in imperial. The _graph_ showed things in meter and feet. So make the DivePlannerPointsModel always convert things to and from the user units. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d031b54d16
commit
58b668c714
3 changed files with 11 additions and 2 deletions
7
dive.c
7
dive.c
|
@ -101,6 +101,13 @@ double get_volume_units(unsigned int ml, int *frac, const char **units)
|
|||
return vol;
|
||||
}
|
||||
|
||||
unsigned int units_to_depth(double depth)
|
||||
{
|
||||
if (get_units()->length == METERS)
|
||||
return rint(depth * 1000);
|
||||
return feet_to_mm(depth);
|
||||
}
|
||||
|
||||
double get_depth_units(unsigned int mm, int *frac, const char **units)
|
||||
{
|
||||
int decimals;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue