[Marble-bugs] [Bug 303187] Support for different/high DPI devices

Marcos Dione mdione at grulic.org.ar
Sun Jul 8 12:42:08 UTC 2012


https://bugs.kde.org/show_bug.cgi?id=303187

--- Comment #1 from Marcos Dione <mdione at grulic.org.ar> ---
several guys from the IRC channel came up with the following hack:

--- 8< ---
diff --git a/src/lib/layers/TextureLayer.cpp b/src/lib/layers/TextureLayer.cpp
index 5712945..ea165dc 100644
--- a/src/lib/layers/TextureLayer.cpp
+++ b/src/lib/layers/TextureLayer.cpp
@@ -214,7 +214,7 @@ bool TextureLayer::render( GeoPainter *painter,
ViewportParams *viewport,
     // As our tile resolution doubles with each level we calculate
     // the tile level from tilesize and the globe radius via log(2)

-    qreal tileLevelF = qLn( linearLevel ) / qLn( 2.0 );
+    qreal tileLevelF = qLn( linearLevel ) / qLn( 2.0 ) - 1;
     int tileLevel = (int)( tileLevelF * 1.00001 ); // snap to the sharper tile
level a tiny bit earlier
                                                    // to work around rounding
errors when the radius
                                                    // roughly equals the
global texture width
--- >8 ---

Which works nice in my N900 (even when it's actually marble 1.3) and might give
an idea on how to implement it.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Marble-bugs mailing list