mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 03:35:53 +01:00
Do not affect the map object scaling when resizing the tiles
This commit is contained in:
parent
0d6b02f466
commit
cd220216dd
@ -59,8 +59,7 @@ public:
|
|||||||
RectC bounds() const;
|
RectC bounds() const;
|
||||||
Range zooms() const
|
Range zooms() const
|
||||||
{return Range(_subFiles.first().min, _subFiles.last().max);}
|
{return Range(_subFiles.first().min, _subFiles.last().max);}
|
||||||
int tileSize() const
|
int tileSize() const {return _tileSize;}
|
||||||
{return _tileSize < 384 ? _tileSize << 1 : _tileSize;}
|
|
||||||
|
|
||||||
void points(const RectC &rect, int zoom, QList<Point> *list);
|
void points(const RectC &rect, int zoom, QList<Point> *list);
|
||||||
void paths(const RectC &searchRect, const RectC &boundsRect, int zoom,
|
void paths(const RectC &searchRect, const RectC &boundsRect, int zoom,
|
||||||
|
@ -167,18 +167,19 @@ void MapsforgeMap::cancelJobs(bool wait)
|
|||||||
|
|
||||||
void MapsforgeMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
|
void MapsforgeMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
|
||||||
{
|
{
|
||||||
QPointF tl(floor(rect.left() / _data.tileSize()) * _data.tileSize(),
|
int tileSize = (_data.tileSize() < 384)
|
||||||
floor(rect.top() / _data.tileSize()) * _data.tileSize());
|
? _data.tileSize() << 1 : _data.tileSize();
|
||||||
|
QPointF tl(floor(rect.left() / tileSize) * tileSize,
|
||||||
|
floor(rect.top() / tileSize) * tileSize);
|
||||||
QSizeF s(rect.right() - tl.x(), rect.bottom() - tl.y());
|
QSizeF s(rect.right() - tl.x(), rect.bottom() - tl.y());
|
||||||
int width = ceil(s.width() / _data.tileSize());
|
int width = ceil(s.width() / tileSize);
|
||||||
int height = ceil(s.height() / _data.tileSize());
|
int height = ceil(s.height() / tileSize);
|
||||||
|
|
||||||
QList<RasterTile> tiles;
|
QList<RasterTile> tiles;
|
||||||
|
|
||||||
for (int i = 0; i < width; i++) {
|
for (int i = 0; i < width; i++) {
|
||||||
for (int j = 0; j < height; j++) {
|
for (int j = 0; j < height; j++) {
|
||||||
QPoint ttl(tl.x() + i * _data.tileSize(), tl.y() + j
|
QPoint ttl(tl.x() + i * tileSize, tl.y() + j * tileSize);
|
||||||
* _data.tileSize());
|
|
||||||
if (isRunning(_zoom, ttl))
|
if (isRunning(_zoom, ttl))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@ -187,8 +188,7 @@ void MapsforgeMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
|
|||||||
painter->drawPixmap(ttl, pm);
|
painter->drawPixmap(ttl, pm);
|
||||||
else {
|
else {
|
||||||
tiles.append(RasterTile(_projection, _transform, &_style, &_data,
|
tiles.append(RasterTile(_projection, _transform, &_style, &_data,
|
||||||
_zoom, QRect(ttl, QSize(_data.tileSize(), _data.tileSize())),
|
_zoom, QRect(ttl, QSize(tileSize, tileSize)), _tileRatio));
|
||||||
_tileRatio));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user