profile: special case time axis

Rounding the axes dimensions to "nice" number may have been a
good idea, but for the time-axis it feels weird.

Therefore revert the time axis to the previous behavior:
range is set according to the data. To differentiate between
time an other axes, use the position: the time axis is the
only axis at the bottom. Yes, that's ugly but pragmatic.

Since we have that flag also use it for the special casing
of the text-display. Spares us one virtual function dispatch.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-10-03 21:15:36 +02:00 committed by Dirk Hohndel
parent 3e11c13100
commit a7a7bd182e
2 changed files with 30 additions and 21 deletions

View file

@ -58,7 +58,7 @@ protected:
QPen gridPen;
color_index_t gridColor;
ProfileScene &scene;
virtual QString textForValue(double value) const;
QString textForValue(double value) const;
virtual QColor colorForValue(double value) const;
Orientation orientation;
QList<DiveTextItem *> labels;
@ -96,7 +96,6 @@ class TimeAxis : public DiveCartesianAxis {
public:
using DiveCartesianAxis::DiveCartesianAxis;
private:
QString textForValue(double value) const override;
QColor colorForValue(double value) const override;
};