mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-31 09:05:14 +01:00
Fixed broken returning from print mode
This commit is contained in:
parent
9eb2e38499
commit
beb966c58f
@ -497,7 +497,7 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
|
|||||||
QRect orig, adj;
|
QRect orig, adj;
|
||||||
qreal ratio, diff, q;
|
qreal ratio, diff, q;
|
||||||
QPointF origScene, origPos;
|
QPointF origScene, origPos;
|
||||||
RectC origC;
|
int zoom;
|
||||||
|
|
||||||
|
|
||||||
// Enter plot mode
|
// Enter plot mode
|
||||||
@ -521,8 +521,8 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
|
|||||||
|
|
||||||
// Adjust the view for printing
|
// Adjust the view for printing
|
||||||
if (hires) {
|
if (hires) {
|
||||||
|
zoom = _map->zoom();
|
||||||
QRectF vr(mapToScene(orig).boundingRect());
|
QRectF vr(mapToScene(orig).boundingRect());
|
||||||
origC = RectC(_map->xy2ll(vr.topLeft()), _map->xy2ll(vr.bottomRight()));
|
|
||||||
origScene = vr.center();
|
origScene = vr.center();
|
||||||
|
|
||||||
QPointF s(painter->device()->logicalDpiX()
|
QPointF s(painter->device()->logicalDpiX()
|
||||||
@ -553,11 +553,11 @@ void MapView::plot(QPainter *painter, const QRectF &target, qreal scale,
|
|||||||
|
|
||||||
// Revert view changes to display mode
|
// Revert view changes to display mode
|
||||||
if (hires) {
|
if (hires) {
|
||||||
_map->zoomFit(orig.size(), origC);
|
_map->setZoom(zoom);
|
||||||
rescale();
|
rescale();
|
||||||
centerOn(origScene);
|
centerOn(origScene);
|
||||||
}
|
}
|
||||||
_mapScale->setDigitalZoom(0);
|
_mapScale->setDigitalZoom(_digitalZoom);
|
||||||
_mapScale->setPos(origPos);
|
_mapScale->setPos(origPos);
|
||||||
|
|
||||||
// Exit plot mode
|
// Exit plot mode
|
||||||
|
@ -208,6 +208,12 @@ int Atlas::zoomFit(const QSize &size, const RectC &br)
|
|||||||
return _zoom;
|
return _zoom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Atlas::setZoom(int zoom)
|
||||||
|
{
|
||||||
|
_mapIndex = -1;
|
||||||
|
_zoom = zoom;
|
||||||
|
}
|
||||||
|
|
||||||
int Atlas::zoomIn()
|
int Atlas::zoomIn()
|
||||||
{
|
{
|
||||||
_zoom = qMin(_zoom + 1, _zooms.size() - 1);
|
_zoom = qMin(_zoom + 1, _zooms.size() - 1);
|
||||||
|
@ -18,6 +18,7 @@ public:
|
|||||||
qreal resolution(const QRectF &rect) const;
|
qreal resolution(const QRectF &rect) const;
|
||||||
|
|
||||||
int zoom() const {return _zoom;}
|
int zoom() const {return _zoom;}
|
||||||
|
void setZoom(int zoom);
|
||||||
int zoomFit(const QSize &size, const RectC &br);
|
int zoomFit(const QSize &size, const RectC &br);
|
||||||
int zoomIn();
|
int zoomIn();
|
||||||
int zoomOut();
|
int zoomOut();
|
||||||
|
@ -16,6 +16,7 @@ public:
|
|||||||
qreal resolution(const QRectF &rect) const;
|
qreal resolution(const QRectF &rect) const;
|
||||||
|
|
||||||
int zoom() const {return _zoom;}
|
int zoom() const {return _zoom;}
|
||||||
|
void setZoom(int zoom) {_zoom = zoom;}
|
||||||
int zoomFit(const QSize &size, const RectC &rect);
|
int zoomFit(const QSize &size, const RectC &rect);
|
||||||
int zoomIn();
|
int zoomIn();
|
||||||
int zoomOut();
|
int zoomOut();
|
||||||
|
@ -24,6 +24,7 @@ public:
|
|||||||
virtual qreal resolution(const QRectF &rect) const = 0;
|
virtual qreal resolution(const QRectF &rect) const = 0;
|
||||||
|
|
||||||
virtual int zoom() const = 0;
|
virtual int zoom() const = 0;
|
||||||
|
virtual void setZoom(int zoom) = 0;
|
||||||
virtual int zoomFit(const QSize &size, const RectC &rect) = 0;
|
virtual int zoomFit(const QSize &size, const RectC &rect) = 0;
|
||||||
virtual int zoomIn() = 0;
|
virtual int zoomIn() = 0;
|
||||||
virtual int zoomOut() = 0;
|
virtual int zoomOut() = 0;
|
||||||
|
@ -24,6 +24,7 @@ public:
|
|||||||
qreal resolution(const QRectF &rect) const;
|
qreal resolution(const QRectF &rect) const;
|
||||||
|
|
||||||
int zoom() const {return _zoom;}
|
int zoom() const {return _zoom;}
|
||||||
|
void setZoom(int zoom) {_zoom = zoom;}
|
||||||
int zoomFit(const QSize &size, const RectC &rect);
|
int zoomFit(const QSize &size, const RectC &rect);
|
||||||
int zoomIn();
|
int zoomIn();
|
||||||
int zoomOut();
|
int zoomOut();
|
||||||
|
@ -21,6 +21,7 @@ public:
|
|||||||
qreal resolution(const QRectF &rect) const;
|
qreal resolution(const QRectF &rect) const;
|
||||||
|
|
||||||
int zoom() const {return _zoom;}
|
int zoom() const {return _zoom;}
|
||||||
|
void setZoom(int zoom) {_zoom = zoom;}
|
||||||
int zoomFit(const QSize &size, const RectC &rect);
|
int zoomFit(const QSize &size, const RectC &rect);
|
||||||
int zoomIn();
|
int zoomIn();
|
||||||
int zoomOut();
|
int zoomOut();
|
||||||
|
@ -163,6 +163,12 @@ int WMSMap::zoomFit(const QSize &size, const RectC &rect)
|
|||||||
return _zoom;
|
return _zoom;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMSMap::setZoom(int zoom)
|
||||||
|
{
|
||||||
|
_zoom = zoom;
|
||||||
|
updateTransform();
|
||||||
|
}
|
||||||
|
|
||||||
int WMSMap::zoomIn()
|
int WMSMap::zoomIn()
|
||||||
{
|
{
|
||||||
_zoom = qMin(_zoom + 1, _zooms.size() - 1);
|
_zoom = qMin(_zoom + 1, _zooms.size() - 1);
|
||||||
|
@ -21,6 +21,7 @@ public:
|
|||||||
qreal resolution(const QRectF &rect) const;
|
qreal resolution(const QRectF &rect) const;
|
||||||
|
|
||||||
int zoom() const {return _zoom;}
|
int zoom() const {return _zoom;}
|
||||||
|
void setZoom(int zoom);
|
||||||
int zoomFit(const QSize &size, const RectC &rect);
|
int zoomFit(const QSize &size, const RectC &rect);
|
||||||
int zoomIn();
|
int zoomIn();
|
||||||
int zoomOut();
|
int zoomOut();
|
||||||
|
@ -143,6 +143,12 @@ qreal WMTSMap::resolution(const QRectF &rect) const
|
|||||||
return ds/ps;
|
return ds/ps;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void WMTSMap::setZoom(int zoom)
|
||||||
|
{
|
||||||
|
_zoom = zoom;
|
||||||
|
updateTransform();
|
||||||
|
}
|
||||||
|
|
||||||
int WMTSMap::zoomIn()
|
int WMTSMap::zoomIn()
|
||||||
{
|
{
|
||||||
_zoom = qMin(_zoom + 1, _zooms.size() - 1);
|
_zoom = qMin(_zoom + 1, _zooms.size() - 1);
|
||||||
|
@ -21,6 +21,7 @@ public:
|
|||||||
qreal resolution(const QRectF &rect) const;
|
qreal resolution(const QRectF &rect) const;
|
||||||
|
|
||||||
int zoom() const {return _zoom;}
|
int zoom() const {return _zoom;}
|
||||||
|
void setZoom(int zoom);
|
||||||
int zoomFit(const QSize &size, const RectC &rect);
|
int zoomFit(const QSize &size, const RectC &rect);
|
||||||
int zoomIn();
|
int zoomIn();
|
||||||
int zoomOut();
|
int zoomOut();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user