mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-27 21:24:47 +01:00
Yet another print/pdf export fix
This commit is contained in:
parent
b9f7af33d7
commit
eae8e23c6c
16
src/gui.cpp
16
src/gui.cpp
@ -703,11 +703,17 @@ void GUI::plot(QPrinter *printer)
|
||||
0) + UNIT_SPACE + tr("m"));
|
||||
}
|
||||
|
||||
_track->plot(&p, QRectF(0, 300, printer->width(), (0.80 * printer->height())
|
||||
- 400));
|
||||
_elevationGraph->plot(&p, QRectF(0, 0.80 * printer->height(),
|
||||
printer->width(), printer->height() * 0.20));
|
||||
info.plot(&p, QRectF(0, 0, printer->width(), 200));
|
||||
if (_elevationGraph->count()) {
|
||||
_track->plot(&p, QRectF(0, 300, printer->width(),
|
||||
(0.80 * printer->height()) - 400));
|
||||
_elevationGraph->plot(&p, QRectF(0, 0.80 * printer->height(),
|
||||
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()
|
||||
|
@ -354,7 +354,7 @@ void TrackView::plot(QPainter *painter, const QRectF &target)
|
||||
|
||||
orig = viewport()->rect();
|
||||
|
||||
if (target.width()/target.height() > orig.width()/orig.height()) {
|
||||
if (target.width() > target.height()) {
|
||||
ratio = target.width()/target.height();
|
||||
diff = qAbs((orig.height() * ratio) - orig.width());
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
setUpdatesEnabled(false);
|
||||
_plot = true;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user