1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-07-25 07:54:24 +02:00

Code cleanup

This commit is contained in:
2018-10-06 21:15:06 +02:00
parent a3625ac89d
commit 6e92557806
3 changed files with 16 additions and 13 deletions

View File

@ -1,4 +1,5 @@
#include <QPainter>
#include <QtMath>
#include "common/rectc.h"
#include "common/wgs84.h"
#include "config.h"
@ -168,10 +169,10 @@ void WMTSMap::draw(QPainter *painter, const QRectF &rect, Flags flags)
const WMTS::Zoom &z = _zooms.at(_zoom);
QSizeF ts(tileSize(z));
QPoint tl = QPoint((int)floor(rect.left() / ts.width()),
(int)floor(rect.top() / ts.height()));
QPoint br = QPoint((int)ceil(rect.right() / ts.width()),
(int)ceil(rect.bottom() / ts.height()));
QPoint tl = QPoint(qFloor(rect.left() / ts.width()),
qFloor(rect.top() / ts.height()));
QPoint br = QPoint(qCeil(rect.right() / ts.width()),
qCeil(rect.bottom() / ts.height()));
QVector<Tile> tiles;
tiles.reserve((br.x() - tl.x()) * (br.y() - tl.y()));