profile: generalize tick generation

The number of ticks was generated for each axis with custom
code. This code was not aware of the size of the profile and
could result in overly dense or sparse ticks.

Generalize the generation of the ticks. For now, round tick
values to integers. In the future, try to use more "nice"
looking values as we do for the statistics tab.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-09-26 19:10:39 +02:00 committed by Dirk Hohndel
parent 177df72d33
commit 0de40a85b7
4 changed files with 46 additions and 77 deletions

View file

@ -84,7 +84,7 @@ QFont DiveTextItem::getFont(double dpr, double scale)
double DiveTextItem::outlineSpace(double dpr)
{
return 2.0 * outlineSize * dpr; // Double because outline growths to both sides.
return outlineSize * dpr;
}
double DiveTextItem::fontHeight(double dpr, double scale)