From fe69280cc5e5c110b068b59e815e295b7b5f68b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Wed, 29 May 2019 18:27:11 +0200 Subject: [PATCH] Fixed broken zoom fit on IMG maps --- src/map/imgmap.cpp | 23 ++++++++++++++--------- src/map/imgmap.h | 1 + 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/map/imgmap.cpp b/src/map/imgmap.cpp index fc8dc4aa..a16405b1 100644 --- a/src/map/imgmap.cpp +++ b/src/map/imgmap.cpp @@ -109,13 +109,13 @@ QRectF IMGMap::bounds() int IMGMap::zoomFit(const QSize &size, const RectC &rect) { if (rect.isValid()) { - QPointF sc((rect.right() - rect.left()) / size.width(), - (rect.top() - rect.bottom()) / size.height()); - double resolution = qMax(qAbs(sc.x()), qAbs(sc.y())); + RectD pr(rect, _projection, 10); _zoom = _zooms.min(); - for (int i = _zooms.min(); i <= _zooms.max(); i++) { - if (360.0 / (1< &polygons); void drawLines(QPainter *painter, QList &lines,