From 9380f3102288a49db0d1775d15e8541944cef902 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Mon, 25 Dec 2023 11:12:52 +0100 Subject: [PATCH] Code cleanup --- src/map/mbtilesmap.cpp | 15 ++++++++++----- src/map/mbtilesmap.h | 2 ++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/map/mbtilesmap.cpp b/src/map/mbtilesmap.cpp index c916dede..cb9e467f 100644 --- a/src/map/mbtilesmap.cpp +++ b/src/map/mbtilesmap.cpp @@ -382,12 +382,19 @@ void MBTilesMap::cancelJobs(bool wait) _jobs.at(i)->cancel(wait); } +QPointF MBTilesMap::tilePos(const QPointF &tl, const QPoint &tc, + const QPoint &tile, unsigned overzoom) const +{ + return QPointF(tl.x() + ((tc.x() - tile.x()) << overzoom) * tileSize(), + tl.y() + ((tc.y() - tile.y()) << overzoom) * tileSize()); +} + void MBTilesMap::draw(QPainter *painter, const QRectF &rect, Flags flags) { const Zoom &zoom = _zooms.at(_zi); unsigned overzoom = zoom.z - zoom.base; unsigned f = 1U<