summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-03 07:25:52 -0400
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-10-03 07:25:52 -0400
commitb2fcc7c8139742aa9a984d6f36f968bc4a9ed742 (patch)
tree150acefee906a74f4359b98a7744d6077e278be7 /dive.c
parentf8e9c975b78c78d1faacfbf65a1ab768bf9d136f (diff)
downloadsubsurface-b2fcc7c8139742aa9a984d6f36f968bc4a9ed742.tar.gz
Don't keep all the split dives invisibly selected
While the visual state didn't show it, our internal tracking of the selected state was copied causing all kinds of unexpected behavior. With this commit we get this right. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/dive.c b/dive.c
index 321c9d166..a10f18520 100644
--- a/dive.c
+++ b/dive.c
@@ -2860,6 +2860,11 @@ static int split_dive_at(struct dive *dive, int a, int b)
d1 = create_new_copy(dive);
d2 = create_new_copy(dive);
+ /* now unselect the first first segment so we don't keep all
+ * dives selected by mistake. But do keep the second one selected
+ * so the algorithm keeps splitting the dive further */
+ d1->selected = false;
+
dc1 = &d1->dc;
dc2 = &d2->dc;
/*