1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Yet another print/pdf export fix

This commit is contained in:
Martin Tůma 2016-05-21 00:28:06 +02:00
parent b9f7af33d7
commit eae8e23c6c
2 changed files with 12 additions and 7 deletions

View File

@ -703,11 +703,17 @@ void GUI::plot(QPrinter *printer)
0) + UNIT_SPACE + tr("m")); 0) + UNIT_SPACE + tr("m"));
} }
_track->plot(&p, QRectF(0, 300, printer->width(), (0.80 * printer->height()) if (_elevationGraph->count()) {
- 400)); _track->plot(&p, QRectF(0, 300, printer->width(),
_elevationGraph->plot(&p, QRectF(0, 0.80 * printer->height(), (0.80 * printer->height()) - 400));
printer->width(), printer->height() * 0.20)); _elevationGraph->plot(&p, QRectF(0, 0.80 * printer->height(),
info.plot(&p, QRectF(0, 0, printer->width(), 200)); printer->width(), printer->height() * 0.20));
info.plot(&p, QRectF(0, 0, printer->width(), 200));
} else {
_track->plot(&p, QRectF(0, 300, printer->width(),
printer->height() - 300));
info.plot(&p, QRectF(0, 0, printer->width(), 200));
}
} }
void GUI::reloadFile() void GUI::reloadFile()

View File

@ -354,7 +354,7 @@ void TrackView::plot(QPainter *painter, const QRectF &target)
orig = viewport()->rect(); orig = viewport()->rect();
if (target.width()/target.height() > orig.width()/orig.height()) { if (target.width() > target.height()) {
ratio = target.width()/target.height(); ratio = target.width()/target.height();
diff = qAbs((orig.height() * ratio) - orig.width()); diff = qAbs((orig.height() * ratio) - orig.width());
adj = orig.adjusted(-diff/2, 0, diff/2, 0); adj = orig.adjusted(-diff/2, 0, diff/2, 0);
@ -364,7 +364,6 @@ void TrackView::plot(QPainter *painter, const QRectF &target)
adj = orig.adjusted(0, -diff/2, 0, diff/2); adj = orig.adjusted(0, -diff/2, 0, diff/2);
} }
setUpdatesEnabled(false); setUpdatesEnabled(false);
_plot = true; _plot = true;