From 1808804babb7d7f00e798236df16bbef58114a38 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Sun, 10 Jan 2021 12:17:14 -0800 Subject: Make sure to sanitize the gasmix after editing it Otherwise we end up showing the gasmix in a different form after editing for the usual air percentages, because we haven't normalized the gasmix values and store them back in the dive in the non-normalized format. Signed-off-by: Linus Torvalds --- commands/command_edit.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'commands') diff --git a/commands/command_edit.cpp b/commands/command_edit.cpp index 49b1c7cce..62150ad9c 100644 --- a/commands/command_edit.cpp +++ b/commands/command_edit.cpp @@ -1241,6 +1241,7 @@ EditCylinder::EditCylinder(int index, cylinder_t cylIn, EditCylinderType typeIn, cyl[i].gasmix = cylIn.gasmix; cyl[i].bestmix_o2 = cylIn.bestmix_o2; cyl[i].bestmix_he = cylIn.bestmix_he; + sanitize_gasmix(&cyl[i].gasmix); break; } } -- cgit v1.2.3-70-g09d2