Parcourir la source

Fix ratio calculation not being exactly right

Signed-off-by: Alexis Maiquez <almamu@almamu.com>
Alexis Maiquez il y a 4 ans
Parent
commit
e3aa82c2ed
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      src/WallpaperEngine/Render/CWallpaper.cpp

+ 2 - 2
src/WallpaperEngine/Render/CWallpaper.cpp

@@ -219,8 +219,8 @@ void CWallpaper::render (glm::ivec4 viewport, bool renderFrame, bool newFrame)
         windowHeight = video->getHeight ();
     }
 
-    float widthRatio = windowWidth / viewport.z;
-    float heightRatio = windowHeight / viewport.w;
+    float widthRatio = windowWidth / (float) viewport.z;
+    float heightRatio = windowHeight / (float) viewport.w;
 
     if (widthRatio > 1.0f)
     {