mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
Fixed broken zoom handling
This commit is contained in:
parent
00acd48009
commit
56d1ac7ff2
@ -203,18 +203,23 @@ void MapView::updateWaypointsBoundingRect(const Coordinates &wp)
|
|||||||
|
|
||||||
qreal MapView::mapZoom() const
|
qreal MapView::mapZoom() const
|
||||||
{
|
{
|
||||||
RectC br = _tr | _rr | _wr;
|
RectC br;
|
||||||
|
|
||||||
return _map->zoomFit(viewport()->size() - QSize(2*MARGIN, 2*MARGIN),
|
if (_tracks.isEmpty() && _routes.isEmpty() && _waypoints.isEmpty())
|
||||||
br.isValid() ? br : RectC(_map->xy2ll(sceneRect().topLeft()),
|
br = RectC(_map->xy2ll(sceneRect().topLeft()),
|
||||||
_map->xy2ll(sceneRect().bottomRight())));
|
_map->xy2ll(sceneRect().bottomRight()));
|
||||||
|
else
|
||||||
|
br = _tr | _rr | _wr;
|
||||||
|
|
||||||
|
return _map->zoomFit(viewport()->size() - QSize(2*MARGIN, 2*MARGIN), br);
|
||||||
}
|
}
|
||||||
|
|
||||||
QPointF MapView::contentCenter() const
|
QPointF MapView::contentCenter() const
|
||||||
{
|
{
|
||||||
RectC br = _tr | _rr | _wr;
|
if (_tracks.isEmpty() && _routes.isEmpty() && _waypoints.isEmpty())
|
||||||
|
return sceneRect().center();
|
||||||
return br.isValid() ? _map->ll2xy(br.center()) : sceneRect().center();
|
else
|
||||||
|
return _map->ll2xy((_tr | _rr | _wr).center());
|
||||||
}
|
}
|
||||||
|
|
||||||
void MapView::updatePOIVisibility()
|
void MapView::updatePOIVisibility()
|
||||||
|
Loading…
Reference in New Issue
Block a user