From 3cf951275de22afaae438c82f52d9c8d7f68282d Mon Sep 17 00:00:00 2001 From: janbar Date: Sat, 5 Oct 2024 01:48:04 +0200 Subject: [PATCH] add libosmscout patch 1 --- backend/CMakeLists.txt | 1 + backend/libosmscout.patch.1 | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 backend/libosmscout.patch.1 diff --git a/backend/CMakeLists.txt b/backend/CMakeLists.txt index d3c7fb05..e10a9eee 100644 --- a/backend/CMakeLists.txt +++ b/backend/CMakeLists.txt @@ -188,6 +188,7 @@ set(libosmscout_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/libosmscout") # First apply our patches in the source of lib list(APPEND libosmscout_patches + libosmscout.patch.1 ) foreach(patch IN LISTS libosmscout_patches) execute_process( diff --git a/backend/libosmscout.patch.1 b/backend/libosmscout.patch.1 new file mode 100644 index 00000000..32bbbf23 --- /dev/null +++ b/backend/libosmscout.patch.1 @@ -0,0 +1,23 @@ +diff --git a/libosmscout-client-qt/src/osmscoutclientqt/TiledRenderingHelper.cpp b/libosmscout-client-qt/src/osmscoutclientqt/TiledRenderingHelper.cpp +index 9f6b45b9d..f8dd8776d 100644 +--- a/libosmscout-client-qt/src/osmscoutclientqt/TiledRenderingHelper.cpp ++++ b/libosmscout-client-qt/src/osmscoutclientqt/TiledRenderingHelper.cpp +@@ -65,10 +65,16 @@ bool TiledRenderingHelper::RenderTiles(QPainter &painter, + } + } + ++ // enable subpixel rendering so that magnification up to 2x remains ++ // as smooth as possible ++ static constexpr double pitchFactor = 1.5; ++ // the magnification level is adjusted taking into account the pixel ++ // ratio of the request and the fixed dpi of the OSM tile + projection.Set(request.coord, + 0, +- request.magnification, +- request.dpi, ++ Magnification(request.magnification.GetMagnification() ++ * pitchFactor * request.dpi / OSMTile::tileDPI()), ++ OSMTile::tileDPI() / pitchFactor, + width, + height); +