From e38e12f89b81c8aa9ae6f1d8e54aeb35a8226b91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sun, 10 Nov 2019 18:38:47 +0100 Subject: [PATCH] Allow arbitrary zoom levels Closes #244 --- src/map/mapsource.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/map/mapsource.cpp b/src/map/mapsource.cpp index ae644697..5b18875c 100644 --- a/src/map/mapsource.cpp +++ b/src/map/mapsource.cpp @@ -32,7 +32,7 @@ Range MapSource::zooms(QXmlStreamReader &reader) if (attr.hasAttribute("min")) { min = attr.value("min").toString().toInt(&res); - if (!res || !OSM::ZOOMS.contains(min)) { + if (!res || min < 0) { reader.raiseError("Invalid minimal zoom level"); return Range(); } @@ -41,18 +41,13 @@ Range MapSource::zooms(QXmlStreamReader &reader) if (attr.hasAttribute("max")) { max = attr.value("max").toString().toInt(&res); - if (!res || !OSM::ZOOMS.contains(max)) { + if (!res || max < min) { reader.raiseError("Invalid maximal zoom level"); return Range(); } } else max = OSM::ZOOMS.max(); - if (min > max) { - reader.raiseError("Invalid maximal/minimal zoom level combination"); - return Range(); - } - return Range(min, max); }