mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
Optimization
This commit is contained in:
parent
eb8fc7b540
commit
23c18d4acd
@ -260,13 +260,6 @@ void IMGMap::unload()
|
||||
_data->clear();
|
||||
}
|
||||
|
||||
QRectF IMGMap::bounds()
|
||||
{
|
||||
RectD prect(_data->bounds(), _projection);
|
||||
return QRectF(_transform.proj2img(prect.topLeft()),
|
||||
_transform.proj2img(prect.bottomRight()));
|
||||
}
|
||||
|
||||
int IMGMap::zoomFit(const QSize &size, const RectC &rect)
|
||||
{
|
||||
if (rect.isValid()) {
|
||||
@ -320,6 +313,10 @@ Transform IMGMap::transform(int zoom) const
|
||||
void IMGMap::updateTransform()
|
||||
{
|
||||
_transform = transform(_zoom);
|
||||
|
||||
RectD prect(_data->bounds(), _projection);
|
||||
_bounds = QRectF(_transform.proj2img(prect.topLeft()),
|
||||
_transform.proj2img(prect.bottomRight()));
|
||||
}
|
||||
|
||||
QPointF IMGMap::ll2xy(const Coordinates &c)
|
||||
|
@ -18,7 +18,7 @@ public:
|
||||
|
||||
QString name() const {return _data->name();}
|
||||
|
||||
QRectF bounds();
|
||||
QRectF bounds() {return _bounds;}
|
||||
|
||||
virtual int zoom() const {return _zoom;}
|
||||
virtual void setZoom(int zoom);
|
||||
@ -62,6 +62,7 @@ private:
|
||||
int _zoom;
|
||||
Projection _projection;
|
||||
Transform _transform;
|
||||
QRectF _bounds;
|
||||
|
||||
bool _valid;
|
||||
QString _errorString;
|
||||
|
Loading…
Reference in New Issue
Block a user