mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
profile: add space at bottom of temperature graph
The temperature graph connected directly to whatever was below. Thus, the lowest temperature often was not clearly seen. Add a general "bottom border" space to the main chart features and set it to two pixels for the temperature and zero pixels for the rest. Might need some fine-tuning. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
3ae160857d
commit
cf1ad3d831
1 changed files with 7 additions and 6 deletions
|
@ -277,7 +277,8 @@ static auto slope(Func f)
|
||||||
// Helper structure for laying out secondary plots.
|
// Helper structure for laying out secondary plots.
|
||||||
struct VerticalAxisLayout {
|
struct VerticalAxisLayout {
|
||||||
DiveCartesianAxis *axis;
|
DiveCartesianAxis *axis;
|
||||||
double height;
|
double height; // in pixels (times dpr) or a weight if not enough space
|
||||||
|
double bottom_border; // in pixels (times dpr)
|
||||||
bool visible;
|
bool visible;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -334,10 +335,10 @@ void ProfileScene::updateAxes(bool diveHasHeartBeat, bool simplified)
|
||||||
const double minProfileFraction = 0.5;
|
const double minProfileFraction = 0.5;
|
||||||
VerticalAxisLayout secondaryAxes[] = {
|
VerticalAxisLayout secondaryAxes[] = {
|
||||||
// Note: axes are listed from bottom to top, since they are added that way.
|
// Note: axes are listed from bottom to top, since they are added that way.
|
||||||
{ heartBeatAxis, 75.0, prefs.hrgraph && diveHasHeartBeat },
|
{ heartBeatAxis, 75.0, 0.0, prefs.hrgraph && diveHasHeartBeat },
|
||||||
{ percentageAxis, 50.0, prefs.percentagegraph },
|
{ percentageAxis, 50.0, 0.0, prefs.percentagegraph },
|
||||||
{ gasYAxis, 75.0, ppGraphsEnabled(currentdc, simplified) },
|
{ gasYAxis, 75.0, 0.0, ppGraphsEnabled(currentdc, simplified) },
|
||||||
{ temperatureAxis, 50.0, true },
|
{ temperatureAxis, 50.0, 2.0, true },
|
||||||
};
|
};
|
||||||
|
|
||||||
// A loop is probably easier to read than std::accumulate.
|
// A loop is probably easier to read than std::accumulate.
|
||||||
|
@ -359,7 +360,7 @@ void ProfileScene::updateAxes(bool diveHasHeartBeat, bool simplified)
|
||||||
if (!l.visible)
|
if (!l.visible)
|
||||||
continue;
|
continue;
|
||||||
bottomBorder -= l.height * dpr;
|
bottomBorder -= l.height * dpr;
|
||||||
l.axis->setPosition(QRectF(leftBorder, bottomBorder, width, l.height * dpr));
|
l.axis->setPosition(QRectF(leftBorder, bottomBorder, width, (l.height - l.bottom_border) * dpr));
|
||||||
}
|
}
|
||||||
|
|
||||||
height = bottomBorder - topBorder;
|
height = bottomBorder - topBorder;
|
||||||
|
|
Loading…
Reference in a new issue