Printing: scale fonts when printing

This seem to work better, but it misses a couple of items at times (for
example the highest label on some of the axis).

Needs lots more testing.

See #590

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2014-07-09 13:09:52 -07:00
parent 2d77788cb2
commit 76a8e83a54
5 changed files with 30 additions and 4 deletions

View file

@ -1,5 +1,6 @@
#include "divetextitem.h"
#include "animationfunctions.h"
#include "mainwindow.h"
#include <QPropertyAnimation>
#include <QApplication>
@ -61,11 +62,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;
size *= scale * MainWindow::instance()->graphics()->getFontPrintScale();
fnt.setPixelSize(size);
} else {
size = fnt.pointSizeF();
size *= scale;
size *= scale * MainWindow::instance()->graphics()->getFontPrintScale();;
fnt.setPointSizeF(size);
}
QFontMetrics fm(fnt);