Changeset f5a4838 in subsurface


Ignore:
Timestamp:
Jan 28, 2017, 9:04:50 PM (5 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
0e57033
Parents:
279ba58
git-author:
Dirk Hohndel <dirk@…> (01/28/17 21:00:47)
git-committer:
Dirk Hohndel <dirk@…> (01/28/17 21:04:50)
Message:

Fix dive visual editor being too quick to rescale time

When moving the last handle of a dive (in the planner, in dive add, or
when editing a dive), we rescaled the time axis whenever our idea of the
maximum duration that we should show changed. That lead to the odd
situation that you couldn't get to certain dive durations with the
visual editor (e.g. 64 minutes) because just as you approach that time
the scale changes and the dive duration jumps past the desired value.

Fixes issue #174

Signed-off-by: Dirk Hohndel <dirk@…>

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ReleaseNotes/ReleaseNotes.txt

    r279ba58 rf5a4838  
    77~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    88
     9- Fix scaling issue that prevent the visual dive editor from reaching
     10  certain dive durations
    911- Prevent double click on dive number in dive list from (temporarily) editing
    1012  dive number
  • profile-widget/profilewidget2.cpp

    rf7cecf5 rf5a4838  
    625625        plotInfo = calculate_max_limits_new(&displayed_dive, currentdc);
    626626        create_plot_info_new(&displayed_dive, currentdc, &plotInfo, !shouldCalculateMaxDepth);
    627         if (shouldCalculateMaxTime)
    628                 maxtime = get_maxtime(&plotInfo);
     627        int newMaxtime = get_maxtime(&plotInfo);
     628        if (shouldCalculateMaxTime || newMaxtime > maxtime)
     629                maxtime = newMaxtime;
    629630
    630631        /* Only update the max depth if it's bigger than the current ones
     
    857858                return;
    858859        QGraphicsView::mousePressEvent(event);
    859         if (currentState == PLAN)
     860        if (currentState == PLAN || currentState == ADD || currentState == EDIT)
    860861                shouldCalculateMaxTime = false;
    861862}
     
    882883                return;
    883884        QGraphicsView::mouseReleaseEvent(event);
    884         if (currentState == PLAN) {
     885        if (currentState == PLAN || currentState == ADD || currentState == EDIT) {
    885886                shouldCalculateMaxTime = true;
    886887                replot();
Note: See TracChangeset for help on using the changeset viewer.