mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
Control growth of time axis
While dragging waypoints around, don't grow the time axis according to dive duration (including deco stops) as this can explode too easly resulting in an effectively unresponsive planner. Rather grow it only (slowly) when a dive handler is moved to the right 10% of the profile. Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
parent
1985bcb29e
commit
e06b507230
1 changed files with 4 additions and 1 deletions
|
@ -683,7 +683,8 @@ void ProfileWidget2::plotDive(struct dive *d, bool force)
|
|||
percentageAxis->setVisible(false);
|
||||
percentageAxis->updateTicks(HR_AXIS);
|
||||
#endif
|
||||
timeAxis->setMaximum(maxtime);
|
||||
if (shouldCalculateMaxTime)
|
||||
timeAxis->setMaximum(maxtime);
|
||||
int i, incr;
|
||||
static int increments[8] = { 10, 20, 30, 60, 5 * 60, 10 * 60, 15 * 60, 30 * 60 };
|
||||
/* Time markers: at most every 10 seconds, but no more than 12 markers.
|
||||
|
@ -1822,6 +1823,8 @@ void ProfileWidget2::recreatePlannedDive()
|
|||
int minutes = lrint(timeAxis->valueAt(activeHandler->pos()) / 60);
|
||||
if (minutes * 60 <= mintime || minutes * 60 >= maxtime)
|
||||
return;
|
||||
if (minutes * 60 > timeAxis->maximum() * 0.9)
|
||||
timeAxis->setMaximum(timeAxis->maximum() * 1.02);
|
||||
|
||||
divedatapoint data = plannerModel->at(index);
|
||||
data.depth.mm = lrint(profileYAxis->valueAt(activeHandler->pos()) / M_OR_FT(1, 1)) * M_OR_FT(1, 1);
|
||||
|
|
Loading…
Reference in a new issue