]> git.sur5r.net Git - i3/i3/blobdiff - libi3/dpi.c
truncate DPI to an integer before multiplying (Thanks eeemsi)
[i3/i3] / libi3 / dpi.c
index c015065ba404f631d61b11e522398c56fa2b179b..5fd4cbca3a02916f2e6f5c1bbbe5b28295138028 100644 (file)
@@ -10,7 +10,7 @@ extern xcb_screen_t *root_screen;
  *
  */
 int logical_px(const int logical) {
-    const double dpi = (double)root_screen->height_in_pixels * 25.4 /
-                       (double)root_screen->height_in_millimeters;
+    const int dpi = (double)root_screen->height_in_pixels * 25.4 /
+                    (double)root_screen->height_in_millimeters;
        return ceil((dpi / 96.0) * logical);
 }