diff options
author | Jan Mulder <jlmulder@xs4all.nl> | 2018-01-29 13:13:29 +0100 |
---|---|---|
committer | Jan Mulder <jlmulder@xs4all.nl> | 2018-01-31 14:48:31 +0100 |
commit | 20dc6a31f4fd736df297c179df1825d48eb7f757 (patch) | |
tree | 9ba7b200b5be8f433b8e085bd845d0b97065ed59 /profile-widget/profilewidget2.cpp | |
parent | e4c8d6968f7b0410c600b821df372c123539c71a (diff) | |
download | subsurface-20dc6a31f4fd736df297c179df1825d48eb7f757.tar.gz |
profile: replot handles while planning
The settingsChanged() function of the profile widget tries to be
clever and tries to prevent not needed replots of the profile.
I'm not sure this is very relevant in the first place as change
of settings are almost instantly, with or without replot. It
appears that replot is always executed when there are
calculated ceilings visible. But without calculated ceilings
a replot is "optimized out". This does, however, introduce dangling
divehandles in PLAN/EDIT and ADD mode of the profile, when
any setting that influences the y-axis is changed.
The fix is trivial. Just force a replot in the PLAN/EDIT and ADD
modes.
Fixes: #1070
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
Diffstat (limited to 'profile-widget/profilewidget2.cpp')
-rw-r--r-- | profile-widget/profilewidget2.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index b36d73da2..3a32263cc 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -801,7 +801,14 @@ void ProfileWidget2::settingsChanged() { // if we are showing calculated ceilings then we have to replot() // because the GF could have changed; otherwise we try to avoid replot() - bool needReplot = prefs.calcceiling; + // but always replot in PLAN/ADD/EDIT mode to avoid a bug of DiveHandlers not + // being redrawn on setting changes, causing them to become unattached + // to the profile + bool needReplot; + if (currentState == ADD || currentState == PLAN || currentState == EDIT) + needReplot = true; + else + needReplot = prefs.calcceiling; #ifndef SUBSURFACE_MOBILE gasYAxis->settingsChanged(); // Initialize ticks of partial pressure graph if ((prefs.percentagegraph||prefs.hrgraph) && PP_GRAPHS_ENABLED) { |