mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: fix y-coordinate of picture thumbnails
When changing from relative to absolute scaling of the char elements, positioning of the picture thumbnails was broken. To emulate the old behavior, add a function to DiveCartesianAxis, that allows positioning with respect to the axis on the screen. To simplify tuning of the poctuire positions, name a few constants explicitly. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
51be326879
commit
6cc6fe4d91
3 changed files with 25 additions and 5 deletions
|
@ -375,6 +375,18 @@ qreal DiveCartesianAxis::posAtValue(qreal value) const
|
|||
return adjusted;
|
||||
}
|
||||
|
||||
double DiveCartesianAxis::screenPosition(double pos) const
|
||||
{
|
||||
QLineF m = line();
|
||||
double from = position == Position::Bottom ? m.x1() : m.y1();
|
||||
double to = position == Position::Bottom ? m.x2() : m.y2();
|
||||
|
||||
if ((position == Position::Bottom) == inverted)
|
||||
pos = 1.0 - pos;
|
||||
|
||||
return (to - from) * pos + from;
|
||||
}
|
||||
|
||||
double DiveCartesianAxis::maximum() const
|
||||
{
|
||||
return max;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue