Mercurial > hg > syntilista
comparison src/printing.cpp @ 167:c54ad71c1205
Apply (kludgey) adjustment scales for printed page to avoid overflow ..
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 19 Sep 2017 13:14:51 +0300 |
parents | 9511e2f250be |
children | 636a24c76232 |
comparison
equal
deleted
inserted
replaced
166:9511e2f250be | 167:c54ad71c1205 |
---|---|
11 #include "main.h" | 11 #include "main.h" |
12 | 12 |
13 #define APP_PRINT_WIDTH 1000 | 13 #define APP_PRINT_WIDTH 1000 |
14 #define APP_PRINT_HEIGHT 1300 | 14 #define APP_PRINT_HEIGHT 1300 |
15 | 15 |
16 #define APP_PRINT_WSCALE 1.01f | |
17 #define APP_PRINT_HSCALE 1.00f | |
18 | |
16 | 19 |
17 void SyntilistaMainWindow::on_button_Print_clicked() | 20 void SyntilistaMainWindow::on_button_Print_clicked() |
18 { | 21 { |
19 // Create a printer object and force some basic settings | 22 // Create a printer object and force some basic settings |
20 QPrinter printer(QPrinter::HighResolution); | 23 QPrinter printer(QPrinter::HighResolution); |
135 return false; | 138 return false; |
136 } | 139 } |
137 | 140 |
138 pt->save(); | 141 pt->save(); |
139 pt->scale( | 142 pt->scale( |
140 pt->device()->width() / (float) APP_PRINT_WIDTH, | 143 pt->device()->width() / ((float) APP_PRINT_WIDTH * APP_PRINT_WSCALE), |
141 pt->device()->height() / (float) APP_PRINT_HEIGHT); | 144 pt->device()->height() /((float) APP_PRINT_HEIGHT * APP_PRINT_HSCALE)); |
142 | 145 |
143 QFont font1; | 146 QFont font1; |
144 font1.setFamily("Arial"); | 147 font1.setFamily("Arial"); |
145 font1.setPixelSize(24); | 148 font1.setPixelSize(24); |
146 SLDrawContext ctx(pt); | 149 SLDrawContext ctx(pt); |