mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-11 19:41:30 +00:00
Printing: calculate a much more accurate font scale value
This simply uses the relative size of the profile. This can result in truly tiny text in print, but at least it's consistent and logical. We could add some minimum value there but I'm not sure that's the right answer, either. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
64aace63f0
commit
4687f5d3b4
1 changed files with 3 additions and 1 deletions
|
@ -61,11 +61,11 @@ void Printer::render(int Pages = 0)
|
||||||
int profileFrameStyle = profile->frameStyle();
|
int profileFrameStyle = profile->frameStyle();
|
||||||
int animationOriginal = prefs.animation_speed;
|
int animationOriginal = prefs.animation_speed;
|
||||||
double fontScale = profile->getFontPrintScale();
|
double fontScale = profile->getFontPrintScale();
|
||||||
|
double printFontScale = 1.0;
|
||||||
|
|
||||||
// apply printing settings to profile
|
// apply printing settings to profile
|
||||||
profile->setFrameStyle(QFrame::NoFrame);
|
profile->setFrameStyle(QFrame::NoFrame);
|
||||||
profile->setPrintMode(true, !printOptions->color_selected);
|
profile->setPrintMode(true, !printOptions->color_selected);
|
||||||
profile->setFontPrintScale(pageSize.width() * 0.001);
|
|
||||||
profile->setToolTipVisibile(false);
|
profile->setToolTipVisibile(false);
|
||||||
prefs.animation_speed = 0;
|
prefs.animation_speed = 0;
|
||||||
|
|
||||||
|
@ -81,8 +81,10 @@ void Printer::render(int Pages = 0)
|
||||||
|
|
||||||
QSize originalSize = profile->size();
|
QSize originalSize = profile->size();
|
||||||
if (collection.count() > 0) {
|
if (collection.count() > 0) {
|
||||||
|
printFontScale = (double)collection.at(0).geometry().size().height() / (double)profile->size().height();
|
||||||
profile->resize(collection.at(0).geometry().size());
|
profile->resize(collection.at(0).geometry().size());
|
||||||
}
|
}
|
||||||
|
profile->setFontPrintScale(printFontScale);
|
||||||
|
|
||||||
int elemNo = 0;
|
int elemNo = 0;
|
||||||
for (int i = 0; i < Pages; i++) {
|
for (int i = 0; i < Pages; i++) {
|
||||||
|
|
Loading…
Reference in a new issue