profile: rename printFontScale to dpr (device pixel ratio)

The printFontScale is used to scale up fonts (and icons) when
rendering to high-DPI devices. With absolute scaling, this
will also be used to scale the size of different chart
regions, line thickness, etc. Therefore, give it an more
appropriate name. "Device pixel ratio", which is a well
established term, seems to appropriately describe the
concept.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2021-08-09 16:48:08 +02:00 committed by Dirk Hohndel
parent d28f4d5347
commit f713858ba4
15 changed files with 97 additions and 98 deletions

View file

@ -8,11 +8,11 @@
#include <QDebug>
#include <QApplication>
DiveTextItem::DiveTextItem(double printScale, QGraphicsItem *parent) : QGraphicsItemGroup(parent),
DiveTextItem::DiveTextItem(double dpr, QGraphicsItem *parent) : QGraphicsItemGroup(parent),
internalAlignFlags(Qt::AlignHCenter | Qt::AlignVCenter),
textBackgroundItem(new QGraphicsPathItem(this)),
textItem(new QGraphicsPathItem(this)),
printScale(printScale),
dpr(dpr),
scale(1.0)
{
setFlag(ItemIgnoresTransformations);
@ -69,11 +69,11 @@ void DiveTextItem::updateText()
QFont fnt(qApp->font());
if ((size = fnt.pixelSize()) > 0) {
// set in pixels - so the scale factor may not make a difference if it's too close to 1
size *= scale * printScale;
size *= scale * dpr;
fnt.setPixelSize(lrint(size));
} else {
size = fnt.pointSizeF();
size *= scale * printScale;
size *= scale * dpr;
fnt.setPointSizeF(size);
}
QFontMetrics fm(fnt);